micro webservice stores bigfive answers
POST /
$ curl -v -H "Authorization: INSERT-JWT-TOKEN" http://localhost:3000 -d '{"someData": "this is posted to database" }'
PUT /:id
$ curl -v -H "Authorization: INSERT-JWT-TOKEN" http://localhost:3000/58a475c47bd88a143a79d4a2 -X PUT -d '{"someData": "this is posted to database" }'
{
"id": "58a475c47bd88a143a79d4a2"
}
GET /search
$ curl -v http://localhost:3000/search
[
{
"_id":"58a474c4fa5fdf11fe3176e4",
"testType":"personality",
"langCode":"no",
"data":{
"O":{
"score":33,
"count":10,
"result":"positive",
"facet":{
}
},
"N":{
"score":21,
"count":10,
"result":"negative",
"facet":{
}
},
"E":{
"score":31,
"count":10,
"result":"positive",
"facet":{
}
},
"C":{
"score":31,
"count":10,
"result":"positive",
"facet":{
}
},
"A":{
"score":30,
"count":10,
"result":"neutral",
"facet":{
}
}
}
}
]
GET /?id=58a475c47bd88a143a79d4a2
$ curl -v http://localhost:3000/?id=58a475c47bd88a143a79d4a2
Same as get all data
DELETE /:id
$ curl -v -H "Authorization: INSERT-JWT-TOKEN" -X DELETE -v http://localhost:3000/58a475c47bd88a143a79d4a2
{
"id": "58a475c47bd88a143a79d4a2"
}
now secret add BIGFIVE_SAVE_DATABASE_URL something.mlab.com
now secret add BIGFIVE_SAVE_DB bigfive
now secret add BIGFIVE_SAVE_USER bigfive
now secret add BIGFIVE_SAVE_PASSWORD password
now secret add BIGFIVE_SAVE_PORT 53659
now secret add BIGFIVE_SAVE_TOKEN_KEY "Gibberish, jibberish, jibber-jabber and gobbledygook"
now -E results.env