Giter Club home page Giter Club logo

aps's Introduction

s## 0. Install node packages

sudo npm install

1. Prepare the database

Create the database using the same user (might be necessary to change the login configurations in pg_hba.conf, the method should be md5 [?])

createdb test_150111

Run the initial scripts (create tables, sql functions, views, etc):

cd database 
./run_sql.sh test_150111

Set the environment:

cd .. 
export NODE_ENV=prod

Update the configuration settings for the database (user, password and database name) for the environment that was defined:

emacs config/prod.js
(edit the values in db.postgres)

Insert the initial data:

node database/initial-data/populate/index.js 

2. Set the required configurations in config/prod.js

emacs config/prod.js
(edit publicUri and publicPort)

3. Start the application

Make sure the required global modules are installed (nodemon, forever)

sudo npm install forever -g
sudo npm install nodemon -g

Make a quick test with nodemon:

nodemon index.js

Then run the app permanently with forever or PM2 (the app will execute in "deamon mode"):

export NODE_APP_NAME=clima

sudo forever start -m 50 -l forever_output.log -o server_stdout.log -e server_stderr.log --append --verbose --spinSleepTime 2000 --minUptime 1000  --uid "$NODE_APP_NAME" index.js

4. Commands to manage the process with forever

List all the processes:

sudo forever list

Stop the process with the given reference (stop it before any updates):

sudo forever stop $NODE_APP_NAME

aps's People

Contributors

paulovieira avatar

Watchers

 avatar  avatar  avatar

Forkers

jacks-load01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.