Simple Restful Api with Node.js
- Node.js
- Express.js
- Knex.js
- JWT / Passport
- Consign
- Postgres
- Docker
- Dockerfile
- docker-compose
- Jest
- supertest
- Nginx
Applications that need to be installed in the development environment:
- node
- npm
- docker
-
Install dependencies on "/app" and "/load_test":
$ npm i -
Create and execute all containers on port 80 (nginx), on root folder:
$ docker-compose up$ docker-compose down(to stop and delete the containers) -
Run api locally on port 3000 (node):
$ cd app$ npm start -
Run tests locally:
$ cd app$ npm test -
Run load_test:
-
Initialize the containers:
$ docker-compose up -d(root folder, -d run in background) -
Initialize the load test:
$ cd load_test$ npm start -
And in another terminal, launch real-time monitoring:
$ docker stats
-
