A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
$ npm install
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
1)make .env file in the root folder for all needed env variables. List of variables you can find in constants.js 2)Docker service must be installed on the server and started. 3)Create docker imgage. Run this command in the root folder of this project:
docker build -t anyname .
anyname - name that willbe used to save this image and than start container
4)run docker container Run this command in the root folder of this project:
docker run -v ${PWD}:/usr/src/app --name node-api -d anyname
anyname -name that was used to save image
--network=host - needed if any(or all) databases are on the localhost, if they are on other server you can use -p 9090:9090
to publish server on any port.
-v ${PWD}
- files folder in the root of this project were will be saved all images(avatars), you can choose other place.
--name node-api
- optional parameter name used to find container
--env NODE_ENV=production
- add node env production mode
5)As a quick test you can open swagger, link described above.
1)docker ps
to check started container or not(docker ps -a to show all container with stopped)
2)docker logs node-api
- check logs after start
3)docker rm node-api
-delete container
4)docker image rm anyname
-delete image
5)docker restart container_id
- restart container after git pull / create new build
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.