An example of a dockerized node API built with hapijs, mongodb and mongoose.
$ npm install
Watch *.js files and restart the server.
$ node start
Login with sample admin user:
$ curl -H "Content-Type: application/json" -X POST -d '{"email": "[email protected]", "password": "admin"}' http://localhost:9001/login
This will return a token replace <token> by that value and try retrieving the list of users:
$ curl -H "Authorization: Bearer <token>" http://localhost:9001/users
$ npm test
$ npm run coverage
Run ESLint
$ npm run lint
Start docker and run:
$ docker-compose up
See docker-compose.yml and Dockerfile
Will install al dependencies, and run the api server in production mode.
Image at DockerHub dciccale/node-api-mongo-docker
With CircleCI, see circle.yml
Build url: https://circleci.com/gh/dciccale/node-api-mongo-docker
Content type
Image
Digest
sha256:3bc24d534…
Size
260.7 MB
Last updated
almost 11 years ago
docker pull dciccale/node-api-mongo-docker