Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount Express router with OpenAPI spec #2389

Closed
4 tasks done
bajtos opened this issue Feb 14, 2019 · 0 comments
Closed
4 tasks done

Mount Express router with OpenAPI spec #2389

bajtos opened this issue Feb 14, 2019 · 0 comments

Comments

@bajtos
Copy link
Member

bajtos commented Feb 14, 2019

This is a follow-up for the spike #2318, see the discussion and PoC code for more context.

Implement app.mountExpressRouter(basePath, router, spec?) to allow LB4 app developers to add arbitrary set of Express routes and provide OpenAPI spec

mountExpressRouter(
  basePath: string,
  router: ExpressRequestHandler,
  spec?: RouterSpec,
): void;

The new API should build on the foundation laid down by StaticAssetsRoute and allows LB4 app
developers to add arbitrary set of Express routes and provide OpenAPI spec.

As a result, LB4 will have the following request-handling pipeline:

  1. Request-preprocessing middleware like CORS, this is not customizable yet.
  2. Native LoopBack 4 routes (controller methods or route handlers).
  3. External Express routers (if the request was not handled yet).
  4. Static assets (if the request was not handled yet).

Related issues: #1849

Acceptance criteria

@dhmlau dhmlau added this to the March 2019 milestone milestone Mar 1, 2019
@bajtos bajtos self-assigned this Mar 4, 2019
@bajtos bajtos removed their assignment Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants