Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/site/Express-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ If the Express middleware only exposes the handler function without a factory or
a single instance is desired, use `toInterceptor`.

```ts
import {toInterceptor} from '@loopback/express';
import {toInterceptor} from '@loopback/rest';
import morgan from 'morgan';

const morganInterceptor = toInterceptor(morgan('combined'));
Expand All @@ -183,7 +183,7 @@ When the Express middleware module exports a factory function that takes an
optional argument for configuration, use `createInterceptor`.

```ts
import {createInterceptor} from '@loopback/express';
import {createInterceptor} from '@loopback/rest';
import helmet, {IHelmetConfiguration} from 'helmet';
const helmetConfig: IHelmetConfiguration = {};
const helmetInterceptor = createInterceptor(helmet, helmetConfig);
Expand All @@ -208,7 +208,7 @@ for the middleware. We can use `defineInterceptorProvider` to simplify
definition of such provider classes.

```ts
import {defineInterceptorProvider} from '@loopback/express';
import {defineInterceptorProvider} from '@loopback/rest';
import helmet, {IHelmetConfiguration} from 'helmet';

const helmetProviderClass = defineInterceptorProvider<IHelmetConfiguration>(
Expand All @@ -225,7 +225,7 @@ import {config} from '@loopback/core';
import {
ExpressMiddlewareInterceptorProvider,
createMiddlewareInterceptorBinding,
} from '@loopback/express';
} from '@loopback/rest';
import helmet, {IHelmetConfiguration} from 'helmet';

class HelmetInterceptorProvider extends ExpressMiddlewareInterceptorProvider<
Expand Down Expand Up @@ -317,7 +317,7 @@ Let's update `src/interceptors/helmet.interceptor.ts:
```ts
import {config, globalInterceptor} from '@loopback/core';
import helmet, {IHelmetConfiguration} from 'helmet';
import {ExpressMiddlewareInterceptorProvider} from '@loopback/express';
import {ExpressMiddlewareInterceptorProvider} from '@loopback/rest';

@globalInterceptor('middleware', {tags: {name: 'Helmet'}})
export class MorganInterceptor extends ExpressMiddlewareInterceptorProvider<
Expand All @@ -343,7 +343,7 @@ To allow a similar usage in LoopBack, we can create an Express router and
register it to LoopBack as follows:

```ts
import {ExpressRequestHandler, Router} from '@loopback/express';
import {ExpressRequestHandler, Router} from '@loopback/rest';

const handler: ExpressRequestHandler = async (req, res, next) => {
res.send(req.path);
Expand Down
2 changes: 1 addition & 1 deletion docs/site/Middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ work with the `MiddlewareContext` - a wrapper object for `request` and
`response`. The signature is of `Middleware` is:

```ts
import {MiddlewareContext} from '@loopback/express';
import {MiddlewareContext} from '@loopback/rest';
import {Next, ValueOrPromise, InvocationResult} from '@loopback/core';

(context: MiddlewareContext, next: Next) => ValueOrPromise<InvocationResult>;
Expand Down
1 change: 0 additions & 1 deletion examples/passport-login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@loopback/authentication-passport": "^2.1.6",
"@loopback/boot": "^2.3.2",
"@loopback/core": "^2.7.1",
"@loopback/express": "^1.2.2",
"@loopback/openapi-v3": "^3.4.2",
"@loopback/repository": "^2.6.0",
"@loopback/rest": "^5.1.0",
Expand Down
3 changes: 0 additions & 3 deletions examples/passport-login/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
{
"path": "../../packages/core/tsconfig.json"
},
{
"path": "../../packages/express/tsconfig.json"
},
{
"path": "../../packages/http-caching-proxy/tsconfig.json"
},
Expand Down