Sample Application with NodeJS and Mosca
Running Locally
First, you need to have a working NodeJS environment:
https://nodejs.org/en/download/
NPM
This application uses npm
to manage its dependencies. Install them with:
npm install
Execute
Web server
npm start
MQTT server
npm run start-tcp
Deploying on Scalingo
Create an application on https://scalingo.com with a MongoDB and a TCP addon, then:
git remote add scalingo git@scalingo.com:<name_of_your_app>.git
git push scalingo master
scalingo -a <name_of_your_app> scale tcp:1
And that's it!
A sample of this application is running at: https://sample-node-mosca.scalingo.io/