0

I have a swagger.conf.json file that serves my documentation for express API and all works well in dev, but for build, this file is not included. How do I include this file in build to server swagger documentation?

My Project Folder:

├── app.ts
├── config
│   └── logger.conf.ts
├── controllers
│   ├── countries.controller.ts
│   └── trails.controller.ts
├── index.ts
├── models
│   ├── country.ts
│   └── trail.ts
├── routes
│   ├── countries.routes.ts
│   └── trails.routes.ts
└── **swagger.conf.json**

Build Folder:

├── app.js
├── config
│   └── logger.conf.js
├── controllers
│   ├── countries.controller.js
│   └── trails.controller.js
├── index.js
├── models
│   ├── country.js
│   └── trail.js
└── routes
    ├── countries.routes.js
    └── trails.routes.js
Pratheesh
  • 1
  • 1

1 Answers1

0

I think there is a better way to do things, but I just ended up converting the whole swagger documentation into a javascript file and importing that file instead, so the compiler picks up the file.

You can refer this repo if you need to take a look at the code. Do let me know if you have better suggestions.

Pratheesh
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 22 '22 at 13:23