-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(rest): app.route() and app.api() #994
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
Conversation
| }); | ||
|
|
||
| describe('RestApplication', () => { | ||
| it('supports function-based routes', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a copy of an existing test which is using server.route.
6271283 to
675ab0e
Compare
|
The tests are a copy and paste of existing tests using |
shimks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for essentially finishing my task here 😆 . The PR looks good to me so far, but I've noticed that with RestApplication, tests were missing for sequence and handler functions. Could we also add in tests for those as part of the PR?
|
Travis fails with the following error: Please fix. |
I have added a new test for Now I need to figure out why the tests are failing. |
|
It turns out What's remaining: fix |
|
All should be good now. @raymondfeng @shimks @kjdelisle please review
@shimks I think we need to update any examples in our documentation on loopback.io to use these new APIs. I'll post a comment in the issue. |
kjdelisle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
jannyHou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Enhance `RestApplication` class to provide shortcuts for registering routes and configuring the master OpenAPI spec. Fix restApp.sequence() - modify RestServer to inherit the sequence binding from the application, modify RestComponent to register the DefaultSequence at the app level (instead of RestServer level). Similarly, modify RestServer to inherit the API_SPEC binding from the application, modify RestComponent to register an empty spec at the app level (instead of RestServer level).
16de4ea to
dd701aa
Compare
Enhance
RestApplicationclass to provide shortcuts for registering routes and configuring the master OpenAPI spec.See #846 and #955.
Checklist
npm testpasses on your machinepackages/cliwere updatedpackages/example-*were updated