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

refactor(rest): rework StaticAssetsRoute into ExternalExpressRoutes #2524

Merged
merged 1 commit into from
Mar 4, 2019

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Mar 4, 2019

Refactor the code handling static assets routes to make it open to extension and allow adding additional types of external routes later in the (near) future.

This commit is a pure refactoring. The only visible change is removal of StaticAssetsRoute from the public API.

See #2389 and the PoC in #2318.

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

@bajtos bajtos added refactor REST Issues related to @loopback/rest package and REST transport in general labels Mar 4, 2019
@bajtos bajtos added this to the March 2019 milestone milestone Mar 4, 2019
@bajtos bajtos self-assigned this Mar 4, 2019
@@ -143,15 +135,14 @@ export class RoutingTable {
return found;
}

// this._staticAssetsRoute will be set only if app.static() was called
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note this comment is no longer true, RestServer is always creating a new instance of StaticAssetsRoute/ExternalRoutes. I am not sure if that's a good thing and an intentional behavior. Either way, fixing it is out of scope of this pull request.

@bajtos bajtos force-pushed the refactor/external-express-routes branch from fabe7b9 to 81be871 Compare March 4, 2019 15:38
Refactor the code handling static assets routes to make it open to
extension and allow adding additional types of external routes
later in the (near) future.

This commit is a pure refactoring. The only visible change is removal
of `StaticAssetsRoute` from the public API.
@bajtos bajtos force-pushed the refactor/external-express-routes branch from 81be871 to e40c1d3 Compare March 4, 2019 15:53
@bajtos bajtos merged commit 23f963c into master Mar 4, 2019
@bajtos bajtos deleted the refactor/external-express-routes branch March 4, 2019 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor REST Issues related to @loopback/rest package and REST transport in general
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants