how to integrate swagger with my express application
I have experience with documenting an Express API using an express module (swagger-node-express
). I also have experience with documenting an Express API using manual Swagger JSON docs.
I would recommend not tying yourself down to a module for your Swagger docs. Most of the modules (and especially swagger-node-express) force you to write your Express code differently to handle the documentation. When manually writing your Swagger docs with JSON, you are able to write Express and decouple the documentation from your routing.
Use Swagger UI to style your documentation and add it to your web page.
Here are some resources you can use when starting out:
Swagger Editor - edit your swagger docs and see your changes live update
Swagger Docs - Swagger specs for JSON
Tutorial - This uses an older version of Swagger, be sure to check out Migrating Swagger to upgrade to the newest version
Also, take a look at this answer explaining the difference between manual and module-based swagger doc generation -> HERE.