Sign inSign up

dciccale/node-api-mongo-docker

By dciccale

•Updated almost 11 years ago

Image
0

1.1K

dciccale/node-api-mongo-docker repository overview

⁠Node API Circle CI

Coverage Status

An example of a dockerized node API built with hapijs⁠, mongodb⁠ and mongoose⁠.

⁠Installation

$ npm install

⁠Development

Watch *.js files and restart the server.

$ node start
⁠Examples

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

⁠Tests

$ npm test

⁠Coverage

$ npm run coverage

⁠Lint

Run ESLint⁠

$ npm run lint

⁠Docker

Install Docker⁠ and Compose⁠

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⁠

⁠Continuous Integration

With CircleCI⁠, see circle.yml⁠

Build url: https://circleci.com/gh/dciccale/node-api-mongo-docker⁠

Tag summary

Content type

Image

Digest

sha256:3bc24d534…

Size

260.7 MB

Last updated

almost 11 years ago

docker pull dciccale/node-api-mongo-docker