Sample node.js server to serve as an interface with Arduino.
There are a number of environment variables that must be provided, otherwise the app won't run as expected. Namely:
- API_KEY: The server key used as authorization for the GCM/FCM services (more on that here). Example: key=AIzaSyZ-1u...0GBYzPu7Udno5aA.
- PASSWORD: The password used as authorization for this app's services. The same password must be used on the mobile app. Example: password.
- ARDUINO_SERIAL_PORT: The name of the serial port to connect to Arduino. Example: COM4 or /dev/tty-usbserial1.
You can do that with this command:
$ set PASSWORD=pass
Run the following command:
$ mongod
After providing the above environment variables and starting up the MongoDB server, run the following commands on another instance of the command line, on the root of this project:
$ npm install && npm start
This assumes you've installed Node.js and MongoDB and added their bin directories to your PATH environment variable.