- Install NodeJs( https://nodejs.org/download/ )
- Open CMD and go to current project directory and run the following commands
- npm install -g bower grunt-cli
- npm install
- grunt
- SET NODE_ENV=production (development for dev environment) for linux machine.
- Server will be running on port specified in /config/appConstants.js
- npm install forever -g (to run the server on the production environment)
- forever start app.js
The /
project directory contains all code used in the application along with all tests of such code.
/
|- config/
|- controllers/
|- env/
|- models/
|- public/
|- middlewares/
|- routes/
|- vendor/
|- views/
|- .gitignore
|- .jshintrc
|- .jshintignore
|- gruntfile.js
|- app.js
|- package.json
|- README.md
|- .rebooted
##API references
- Registering a session:
URL: /user/register-session
METHOD: POST
HEADERS:
appConstants.authHeaders.token: publicKey
REQUEST: {
encryptedData: "encryptedData"
data: {
userId: "a@b.com"
}
}
- Ending a session:
URL: /user/end-session
METHOD: POST
HEADERS:
appConstants.authHeaders.token: publicKey
REQUEST: {
encryptedData: "encryptedData"
data: {
action: "END_SINGLE",
sessionToken: "sessionToken"
}
}
or
REQUEST: {
encryptedData: "encryptedData"
data: {
action: "END_ALL_BY_USER",
sessionToken: "sessionToken"
}
}
or
REQUEST: {
encryptedData: "encryptedData"
data: {
action: "END_ALL"
}
}
- Publish a message:
URL: /publish
METHOD: POST
HEADERS:
appConstants.authHeaders.token: publicKey
REQUEST: {
encryptedData: "encryptedData"
data: {
action: "PUBLISH_SINGLE",
sessionToken: "sessionToken",
message: "jsonstringifiedmessage"
}
}
or
REQUEST: {
encryptedData: "encryptedData"
data: {
action: "PUBLISH_ALL_BY_USER",
sessionToken: "sessionToken",
message: "jsonstringifiedmessage"
}
}
or
REQUEST: {
encryptedData: "encryptedData"
data: {
action: "PUBLISH_ALL",
message: "jsonstringifiedmessage"
}
}
##Help Links