-
Notifications
You must be signed in to change notification settings - Fork 0
Node Services
Micro services are what enable the Arduino setup to be controlled from an Android app independent of what network it is on. You can deploy these services either on your local machine to restrict access to your home network or on a cloud. Depending on what you choose to do, the deployment changes and so does the configuration.
Download the latest release from the releases section - Don't clone the project. All services related items are in the NodeServices folder. Open server.js file & look for the below snippet :
// Include other JS files to implement abstraction
var databaseConfigration = require('./databaseConf');
The databaseConf.js file does not exist in the folder - It contains credentials, server address & port to a MongoDB instance. You will need to create it in the root of the folder and configure it like so :
//File used to configure mongo DB configuration
var mongoDB = {
"databaseUrl" : "subdomain.domain.com",
"port" : 12345,
"name" : "This is my project",
"username" : "funnyUsername",
"password" : "EasyPassword"
}
//Export to module to make it available globally
module.exports = mongoDB;
Open a terminal & navigate to the root directory of the project. Before you run it, you'll need to install all dependencies. Execute to install & deploy locally :
$ npm install && npm start
To test, open a browser and navigate to http://localhost:8080/api if you get the following JSON response, everything is working fine.
{
"message":"Home Automation API is working normally"
}
For any queries or information, open a ticket on the issue tracker. I'll be glad to answer and help you out! For feedback, Send me a Tweet!