A simple user/data project.
Just clone it from github & run npm install
Use nodemon src/app.coffee
or npm start
or bin/start
To insert pre-made data containing a set of users with their own metrics, two ways are available:
- Run
bin/populate
- Through the URL
http://localhost:8888/populate
- Username:
user1
| Password:password1
- Username:
user2
| Password:password2
- Username:
user3
| Password:password3
Send JSON data to localhost:8888/metrics.json/[ID]
The data sent should be arranged this way:
[{
"timestamp" : "x1",
"value" : "y2"
},
{
...
},
{
"timestamp" : "xn",
"value" : "yn"
}]
You can create a new user via the webpage by clicking on the "Create an account button" or through the URL http://localhost:8888/signup
You can also send data to localhost:8888/user.json
The data sent should be arranged this way:
{
"username" : "x",
"password" : "y",
"name" : "z",
"email" : "[email protected]"
}
To link a metric to an user, send data to localhost:8888/usermetrics.json/
The data sent should be arranged this way:
{
"username" : "x",
"id": "y"
}
Send a DELETE request to localhost:8888/metrics.json/[ID]
Send a DELETE request to localhost:8888/user.json/[USERNAME]
Send a DELETE request to localhost:8888/usermetrics.json
The data sent should be arranged this way:
{
"username" : "x",
"id" : "y"
}
Use npm test
or ./bin/test
David Deray
Mégane Pau
Apache2