Code : https://github.com/Sean-Bradley/Seans...
I have an existing NodeJS API and I want to add Swagger-UI to it. This makes the API look much more professional very quickly.
I also use an extension in VSCode called Swagger Viewer, which helps a lot when writing the swagger.json.
After setting up everything and starting the nodejs api server, the swagger documentation is available at http://localhost:3000/swagger
When importing json files in typescript, you may get an error indicating inability to import json files. To fix, you can add
"resolveJsonModule": true,
"esModuleInterop": true,
to your tsconfig compilerOptions.
If you got this far, you probably like TypeScript just like I do,
I have created a course to teach TypeScript together with Socket.IO so please check it out.
• SocketIO TypeScript : Introduction Video