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

Example: mount LB3 app in LB4 #2392

Closed
6 tasks
bajtos opened this issue Feb 14, 2019 · 0 comments · Fixed by #2803
Closed
6 tasks

Example: mount LB3 app in LB4 #2392

bajtos opened this issue Feb 14, 2019 · 0 comments · Fixed by #2803

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.

Create an example app based on loopback-getting-started (@loopback/example-lb3app) to showcase LB3+LB4 integration. Add acceptance tests to verify few REST endpoints, also a test to verify that LB3 endpoints are included in the OpenAPI spec produced by the LB4 app.

Related issues: #1849 #2389 #2391

Acceptance criteria

  • A new example project, e.g. examples/lb3app
  • Copy loopback-getting-started codebase to legacy folder, make the following changes:
    • Disable LB3 error handling in favor of LB4 error handler (PoC)
    • Disable static assets in LB3 app (PoC)
    • Add callback to the boot script creating sample data (PoC)
    • Use debug instead of console.log (PoC)
    • Use use in-memory database instead of MySQL to avoid race conditions (PoC)
  • Add @loopback/booter-v3app to the project and configure it to load the legacy app
  • Write LB4-style acceptance tests for the REST API provided by the LB3 app. Cover the following REST API endpoints:
    • CoffeeShop.create
    • CoffeeShop.find
    • CoffeeShop.status
    • User.create
    • User.login
    • User.findById + provide a valid access token, expect 200
    • User.findById + provide a token of another user, expect authorization error
  • Add an acceptance test to verify the list of REST API endpoints contributed by the LB3 app. Make sure the test reports a useful error message on failure. Doing a deep-equal comparison of the entire OpenAPI spec IS NOT a good solution.
  • Include the new example app in our docs: Examples and tutorials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants