npm init
npm i mysql express sequelize mysql2 dotenv
npm install --save-dev jest supertest
"scripts": {
"test": "jest",
"start": "node index.js"
},
"jest": {
"testEnvironment": "node"
},
# Databases check (give mysql password)
mysql -h localhost -u root -p -e "SHOW DATABASES;"
# MySql Process check (give your system pasword)
sudo lsof -iTCP -sTCP:LISTEN -n -P | grep mysqld
#without payload
curl -vvvv http://localhost:3307/healthz
#with payload
curl -X GET http://localhost:3307/healthz -H "Content-Type: application/json" -d '{"name": "Rama Raju"}'
#without payload
curl -vvvv -XPUT http://localhost:3307/healthz
#with payload
curl -X PUT 'http://localhost:3307/healthz' -H 'Content-Type: application/json' -d '{"name": "Rama Raju"}'
#without payload
curl -X POST 'http://localhost:3307/healthz'
#with payload
curl -X POST 'http://localhost:3307/healthz' -H 'Content-Type: application/json' -d '{"name": "Rama Raju"}'
curl -X DELETE 'http://localhost:3307/healthz'
#without payload
curl -X PATCH 'http://localhost:3307/healthz'
#with payload
curl -X PATCH 'http://localhost:3307/healthz' -H 'Content-Type: application/json' -d '{"name": "Rama Raju"}'
curl -X GET 'http://localhost:3307/healthz?name=ram&neuid=003'
npm test
sudo pkill mysqld
sudo /usr/local/mysql/support-files/mysql.server restart
/v1/user
/v1/user/self
scp -i /path/to/your-ssh-private-key /path/to/your-file.zip centos@droplet-ip:/root
#change the key permission
chmod 600 /path/to/your-private-key
# ssh using private key
ssh -i /path/to/your-private-key root@droplet-ip
sudo dnf install unzip
unzip path/to/your-file.zip
# create the dotenv file for your app in the vm
# install mysql
sudo yum install wget
sudo wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
sudo rpm -Uvh mysql80-community-release-el7-3.noarch.rpm
sudo yum install mysql-server
sudo systemctl start mysqld
sudo systemctl enable mysqld
# give your db credentials
sudo mysql_secure_installation
mysql --version
mysql -u root -p
curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -
sudo yum install -y nodejs
node --version
Enable port on which your application runs & give ssh access only to your ip in firewall settings of ypur vm
SELECT * FROM restapi.Users;