Skip to content

md-web-server/db-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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','[email protected]');

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published