Connect Bastion Host from your computer
ssh -i ~/.ssh/your-key-pair.pem ec2-user@your-instance-bastion-host-ip
Connect Web server with your Bastion Host
ssh -i ~/.ssh/your-key-pair.pem ec2-user@your-instance-web-server-ip
sudo yum update
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
. ~/.nvm/nvm.sh
nvm install 16
node -v
npm -v
Note: Amazon linux 2 supports node 16 and below
sudo yum install git
nano ~/.ssh/id_rsa
Copy your deployer private ssh key and save exit.
chmod 600 ~/.ssh/id_rsa
Change permission of private ssh key
git clone <repository-url>
cd <repository>
npm install
nano src/system_settings/system_settings.service.ts
Change below to your application server
from his.httpService.get<SystemSettingEntitiy[]>('http://localhost:3002/system_settings')
to his.httpService.get<SystemSettingEntitiy[]>('http://your application server ip:3000/system_settings')
npm run build
npm run start:prod
curl "http://localhost:3000/system_settings
This should return your database value on json format
click ctrl+c button to stop
npm install pm2 -g
nano package.json
insert below code inside of "scripts"
"pm2:start": "pm2 start npm --name 'sampleapp-3tier-middleware' -- start",
"pm2:stop": "pm2 stop sampleapp-3tier-middleware",
npm run pm2:start
check pm2 status
pm2 status
check pm2 logs
pm2 logs
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
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.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.