- Install NodeJS: https://nodejs.org/en/
- Open a terminal and move with command
cd
to the directory of the project - Install the Node-Packages with command
sudo npm install
- Create a new folder in
/public/lib
(by command-linemkdir /public/lib
) - Install Bower
sudo npm install -g bower
- Move with command
cd /public
to the directorypublic
- Install Bower-Packages with command
bower install
- Move with command
cd ../
back to the directory of the project - Run NodeJS-Server with the command
node server.js
- Open a web-browser and go to
localhost:8080
POST http://localhost:8080/api/boxes
{
"name": "Perfect Cycling Roads",
"boxType": "mobile"
}
Please remember the generated BoxId
!
POST http://localhost:8080/api/boxes/:boxId/tracks
{
"box_id": "56a4e8380a303b3df692694c"
}
Please remember the generated TrackId
!
POST http://localhost:8080/api/boxes/:boxId/tracks/:trackId/measurements
{
"track_id": "56a4e8660a303b3df692694d",
"timestamp": "12/21/2015 13:37:04",
"lat": 51.965240,
"lng": 7.598272,
"altitude": 353.40,
"speed": 0,
"sound": 41,
"vibration": 1.46,
"brightness": 1134,
"uv": 0,
"ir": 0
}
GET http://localhost:8080/api/boxes/:boxId/tracks/:trackId/measurements
Please see: data.json