Skip to content

Instantly share code, notes, and snippets.

@karanpal-dhillon
Created December 2, 2018 03:55
Show Gist options
  • Save karanpal-dhillon/aac6b05712d5eda7a201a35e5c52a195 to your computer and use it in GitHub Desktop.
Save karanpal-dhillon/aac6b05712d5eda7a201a35e5c52a195 to your computer and use it in GitHub Desktop.
Welcome file
<title>Welcome file</title>

Setup process

Backend (Nodejs) server

Install latest LTS version of NodeJS .
NVM is an easy way to setup nodejs on linux machines.

  • To install NVM, run command
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
  • Above command will add nvm to the .bashrc file. Reload .bashrc
    soruce ~/.bashrc
  • Now NVM command should be available. To install latest version of NodeJS, run command
    nvm install --lts
  • Verify node and npm versions.
    node -v This should output node version, for ex. v10.14.0
    npm -v This should output npm version, for ex 6.4.1
  • Nodejs installation is complete.

Setup code (backend)

  • Back end code is hosted at our bitbucket git server. starup-assist . I have send access invitation to your email but in case you dont want to go through another account setup process, here is the direct link for code download.
    https://www.dropbox.com/s/woeg25t46mccao7/startup-assist.zip?dl=0
    Download source code from above link and unzip it. It should have the following structure.
    enter image description here

  • Update the database config settings in the config/config.json file in case database credentials have changed.

  • We are interested in staging section for now. Refer the screenshot below.
    enter image description here

  • Update usename, password, database and host according to the RDS instance details.

  • CD to the source code directory and run command
    npm install
    Above command will install the required dependencies for code.
    New directory structure should look like
    -enter image description here
    Notice the addition of a folder called node_modules, above package.json file.

  • To run the backend server, execute command
    npm run stag or if you want it to persist after ssh session if closed, run it using nohup.
    nohup npm run stag &

    Above command should start our backend server on port 3000

Make sure port 3000 is open in the security config if you want to test the backend server from your browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment