Quickly scaffold your new API by using a Yeoman generator!
Steps:
- Install yeoman
$ npm i -g yo
- Install generator-swagger-docker-api
$ npm i -g generator-swagger-docker-api
- Run the generator with your app name & company name
$ yo swagger-docker-api <<app-name>> <<company-name>>
- Profit! Or at least have your API scaffolded out so you can start doing all of the things
The package.json version defaults to 1.0.0, but this can be overridden using:
$ yo swagger-docker-api <<app-name>> <<company-name>> --ver=<<version>>
Note that this project uses Swagger for a spec-first API development workflow! Get to know the Swagger 2.0 specification.
After the spec is authored, use $ npm run spec:build
to create a spec.json file. The swagger-tools middleware will automagically handle Express routing based on the spec.json file. Which is pretty cool. In-depth running instructions are provided in the generated README.
This is a beginning work-in-progress, so feel free to provide feedback! Clone it, fork it, adapt it, whatever you need. This is intended to be pretty generic for people that want Dockerized and Swaggerized APIs.
This project was adapted from exp-starter-api by craftninja