Skip to content

sbsoso0411/Nest-Rest-API-TypeORM-PostgreSQL

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Production deploy:

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.

Usefull commands:

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

Support

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.

Stay in touch

License

Nest is MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages