Closed MrSharpp closed 2 months ago
I guess it's most probably because the swagger endpoint shouldn't be available in prod build files, maybe thats why it's throwing 500. my fix would be to just omit /docs or /swagger-yml on build files.
Dupe of https://github.com/ad-on-is/adonis-autoswagger/issues/75
Just fixed in 3.12.0
Edit: Oh... Sorry... your issue is totally different from the dupe I mentioned. You need to run the docs:generate
script as mentioned in the docs, to make it work in production.
did the same in the given steps in docs, the issue is same. you can try the reproduceable repository which i added.
ENOENT: no such file or directory....
i dont know why it trying to access models & other folders without the js extension, if i remove the js extension it shows error for the next file
Is your NODE_ENV set to "production"?
If you did everything correctly, you should have a swagger.yml generated, which you MUST deploy to your production environment. On production, AutoSwagger will obviously not parse any js/ts files, but it will read the generated "swagger.yml" instead, and it should work.
Edit:
did the same in the given steps in docs, the issue is same. you can try the reproduceable repository which i added.
You clearly did not create the commands file for the generation as described in the Readme.
Please follow Readme and report back if it doesn't work
when i try to access /docs which calls /swagger-yml on develop it works fine but it doesnt with build files that request fails with 500 with this console output
Reproduceable Repo: https://github.com/MrSharpp/adonis-bug-rep