-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Api Explorer not working after setting up loopback as a route via express #2548
Comments
I think the tutorial might be incomplete. The server variable is key, Get /books, will be correct as I understand it. Can you confirm that openapi.json server variable is not as follows: "servers": [
{
"url": "http://127.0.0.1:3000/api"
}
] I've a working example /w angular based on pull requests currently undergoing review. Might have some code you can compare to your own. |
Might be addressed in @nabdelgadir's PR: #2552. |
I went through the tutorial again (based on some minor updates made in #2552, but they shouldn't affect this issue) and made a successful POST request to create a As the LoopBack application is mounted on top of the Express server using Can you confirm what the server url is in |
the |
If you've configured the code correctly the servers variable will be correct. Post your code or look at a working example and compare to yours. I've posted a working example above if you look at the server folder, you'll see that it is an lb4 app with the express set up correctly. Up to you. |
I have compared it no difference found ,here is a snippet of my code. server.ts
application.ts
|
Well, you can try commenting out all the additions you've made that are different to a working example and debug from there. |
Description / Steps to reproduce / Feature proposal
I followed the instruction to create Express application with loopback as follows as in this tutorial
Creating an Express Application with LoopBack
If I opened the explorer under /api/explorer , the page is rendering just fine , but no request would work.
The reason behind this is the routes in openapi.json are missing /api
E.g:
the route in openapi.json is Get /books but it should be /api/books
how can I setup openapi to prefix every route with /api ?
Thank you.
The text was updated successfully, but these errors were encountered: