Skip to content

Latest commit

 

History

History
55 lines (44 loc) · 1.02 KB

Readme.md

File metadata and controls

55 lines (44 loc) · 1.02 KB

db-api (express, accessing a mongo database on an ec2 instance)

Setup Information

git clone &&
cd &&
npm install &&
npm start;

Create the config file from the config example

cp .example.config.js config.js

Relavent psql commands:

CREATE database project1;
\c project1;

DELETE from users;

CREATE TABLE users(
firstName text,
lastName text,
npiNumber text,
businessAddress text,
telephoneNumber text,
emailAddress text
);

INSERT INTO users VALUES ('michael', 'dimmitt', '82138','2312 baymeadows way, jacksonville, fl','9022006567','michaelgdimmitt@gmail.com');

Relavent mongo commands:

use project1
db.createCollection("users")

Deploy express with mongo to Ec2:

https://www.youtube.com/watch?v=fIeIzHMC4BQ https://medium.com/@rksmith369/how-to-deploy-mern-stack-app-on-aws-ec2-with-ssl-nginx-the-right-way-e76c1a8cd6c6

cd /var/www
pm2 start express.js

Ec2 instance accessable at:

http://3.19.120.4