There are two sample projects. aws-front-end and aws-back-end. aws-front-end is suppose to have internet facing VM (web server) and aws-back-end is suppose to be the app server, not accessible to the public.
Node js is the only common SDK for both the projects.
- Install node js (using nvm)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
source ~/.bashrc
nvm install node
//This command will install latest LTS version of node and npm
- Download the source code tar.gz file from Dropbox
- Extract the source code file.
- CD into the source code folder and modify database connection parameters.
config/db-config.js
file contains DB connection parameters.
module.exports = { database: 'edstart', username: 'postgres', password: 'postgres', host: 'edstart.cftv5465a2p0.us-east-1.rds.amazonaws.com', dialect: 'postgres'};
- Modify above parameters according to current setup.
- run
npm install
- run
nohup node app.js &
to start the server. - By default,
port 3333
is assigned to the node process. There are two ways we can change the default port. Either we set an environment variable usingexport PORT=80
or we change the default port given in theapp.js
file. Change lineconst port = process.env.PORT || 3333;
to the desired port.
- Download the source code tar.gz file fron Dropbox
- Extract the source code file.
- CD into the source code folder and modify
app server url
config/config.js
file contains app server connection parameter.
module.exports = { baseUrl: 'http://172.31.23.197:3333' };
- Modify above base url. (Internal IP of the app server)
- run
npm install
- run
nohup npm start &
to start the server. - By default,
port 3000
is assigned to the node process. Again, there are two ways to change the default port. Either we set an environment variable usingexport PORT=80
or we change the default port given in thebin/www
file. Line no #41const port = normalizePort(process.env.PORT || '3000');
Endpoints:
Business Form: http://ec2-3-88-157-200.compute-1.amazonaws.com:3000/businesses
Businesses List: http://ec2-3-88-157-200.compute-1.amazonaws.com:3000/businesses/list