This is just an example for a node.js microservice using express.
# download required modules
npm install
# start service
npm start
It's also possible to run the service in a docker container.
# build
docker build -t petstore .
# run
docker run -d -p 3000:3000 petstore
- We use OpenAPI Specification (swagger): https://www.openapis.org/
- The specification is in this file: openapi.yaml
- This project also includes swagger-ui wich is using the root-route (
/index.html
)
Used Modules:
# run tests
npm test
# check code coverage (creates "./coverage/index.html")
npm run-script cover
We use this linter: https://github.com/standard/standard
Auto-Format:
npm run-script format
We use standard-version, please format your commit messages like this:
<type>[optional scope]: <description>
[optional body]
[optional footer]
fix
: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in semantic versioning).feat
: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in semantic versioning).BREAKING CHANGE
: a commit that has the text BREAKING CHANGE: at the beginning of its optional body or footer section introduces a breaking API change (correlating with MAJOR in semantic versioning). A BREAKING CHANGE can be part of commits of any type.- Others: commit types other than fix: and feat: are allowed, for example @commitlint/config-conventional (based on the Angular convention) recommends
chore
,docs
,style
,refactor
,perf
,test
, and others.
For creating a new release, checkout the master
branch and run:
npm run release
or for first:
npm run release -- --first-release