A simple skeleton to start projects using Node.js.
- Docker: v17.06.0
- Docker Compose: v1.14.0
The Api have the structure below:
├── app/
│ ├── NamespaceProject (healthcheck example)
│ │ ├── test/
│ │ ├── namespaceProject.controller.js
│ │ └── namespaceProject.router.js
│ └── index.js
├── Dockerfile
└── docker-compose.ymlTo start the development, clone the project, edit the files and run the project.
git clone git@github.com:luizdesign/nodejs-api-skeleton.gitTo run the project, execute the command:
docker-compose upAfter it you can access http://localhost:3000/healthcheck/.
To rebuild the docker image, run the command below. It's necessary to build a new image with your changes.
docker-compose up --buildOr you can remove and create a new image:
docker images #returns all local docker images
docker rm $dockerImageName #remove the image named $dockerImageName
docker-compose up #recreate the imageYou can run some tests to ensure the code.
Integration test access the api and check te return. To execute them, run the commands below.
# up the Api
docker-compose up
# run the integration test
docker-compose -f test.docker-compose.yml upYou can contribute to improve the project by opening issues, and submitting pull requests. However check the issue list before to avoid duplicate issues.
Remember always on to check the contribution guide.