Skip to content

An example of node application for labs or custom labs

License

Notifications You must be signed in to change notification settings

FCJ-DNTU/sample-01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NodeJS Example Server for AWS Labs & Custom Labs

An example of node application for labs or custom labs

Prerequisite

You must have these dependencies to clone and run this app

Install

Easy to install, just cd to this repository folder and

Linux

bash install.sh

Windows

./install.sh

Start

You should start server with bash script

Flags

  • --port=: specify your port number, please note that the port must be valid.

  • --hostname=: specify IP address, 0.0.0.0 is default. Note: I'll update more!!!

Linux

bash start.sh
bash start.sh --port=7000 # Your app is running on 0.0.0.0:7000
bash start.sh --hostname=127.0.0.1 --port=7000 # Your app is running on 127.0.0.1:7000
# OR
bash start.sh --port=7000 --hostname=127.0.0.1 # Your app is running on 127.0.0.1:7000

Windows

./start.sh
./start.sh --port=7000 # Your app is running on 0.0.0.0:7000
./start.sh --hostname=127.0.0.1 --port=7000 # Your app is running on 127.0.0.1:7000
# OR
./start.sh --port=7000 --hostname=127.0.0.1 # Your app is running on 127.0.0.1:7000

Keep process alive at every server restart

We use pm2 to handle this task. It works well on linux

pm2 startup
pm2 start /path/to/node.js

Note: remember, when your enter pm2 startup and hit enter, look the log carefully for extra configuration!!!

About

An example of node application for labs or custom labs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published