Skip to content

mondyfy/hackathon-server

Repository files navigation

Hackathon Backend Server

Hackathon API.

Environment

$ cp .env.example .env

Installation

$ yarn

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Generate Migration From Entity

$ yarn typeorm migration:generate -n  migrations_name

Run Migration

$ yarn typeorm migration:run

Rollback Migration

$ yarn typeorm migration:revert

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

Deployment(PM2)

# sync changes(for .env compare with .env.example)
1. git pull origin <branch>

# install dependencies
2. yarn

# build dist
3. yarn build

# run migration (if any)
4. yarn typeorm migration:run

# start service: 
5. pm2 start dist/main.js --name <name>:<port>