REST API built with Node, Express, PassportJS, MongoDB, Mongoose and Socket.io.
# inside the cloned repository
# install dependencies
$ npm install
# run server
$ gulp serve
The server.conf.js file is expecting certain environment variables to be set within Node. The env.conf.js has functions to check whether the expected environment variables have been setup before proceeding to start up the rest of the server. It uses a file called config.json stored in the config directory that looks something like this:
{
"HOST" : "https://medidation.sirimangalo.org",
"ENV" : "development",
"PORT" : 3000,
"MONGO_URI" : {
"DEVELOPMENT" : "mongodb://[username:password]@host[:port]",
"PRODUCTION" : "mongodb://[username:password]@host[:port]",
"TEST" : "mongodb://[username:password]@host[:port]"
},
# Generate your own 256-bit WEP key here:
# http://randomkeygen.com/
# Note that you don't need to use specifically
# this, but it will certainly suffice
"SESSION_SECRET" : "the session secrect",
# You can generate a key with a Google account at https://console.developers.google.com/
# (needs Google Cloud Messaging and YouTube Data API to be activated first)
"GOOGLE_API_KEY" : "the google api key"
}