-
Notifications
You must be signed in to change notification settings - Fork 8
Description
I stood up a starter Adonis5 application (API) and I'm trying to get it to run in production on Heroku. As a temporary workaround, I hard coded mode: 'RUNTIME' inside of swagger.ts. This seemed to work fine and I could see my one controller's docs just fine. Of course, I have since put this back.
First, I ran into this issue: #41
- Commenting out
PORTandAPP_NAMEworked for me (inenv.ts).
Then, I ran into this issue: #33
- Creating a
/docsfolder with a/docs/.keepfinally made the build successful.
However, now my docs have all disappeared. The swagger page shows this error: No operations defined in spec! and my swagger.json file appears to have been built like this:
{"openapi":"3.0.0","info":{"title":"My Adonis5 App","version":"1.0.0"},"paths":{},"components":{},"tags":[]}I checked the server and both files were built this way...the one in /docs/swagger.json and then the one that got copied to /build/docs/swagger.json.
As per the instructions (https://github.com/reg2005/adonis5-swagger#production-using) my package.json file has the postbuild script:
"build" : "node ace build --production",
"postbuild" : "node ace swagger:generate && cp -a docs/ build/docs",
My versions:
adonis5-swagger : 1.4.1
node : 20.2.0
If I run node ace swagger:generate locally, it creates the proper /docs/swagger.json file. Any idea why it's empty in production?