Earlier today I made a small REST API using typescript with node.js and express which persists rsps userdata to a MongoDb database hosted for free at MongoLab (www.mlab.com).
Even though it’s something rather small, some people might find it useful, that’s why I’m posting it over here.
The zip contains the webserver with a small Java projects which calls the REST API over HTTP.
There are three routes available:
/api/user/register
/api/user/login
/api/user/save
The register route just enters a new document in the users collection if the username isn’t already taken.
The login route checks whether the provided credentials are correct.
The save route updates the player’s document with the newly provided info.
Example of a user document: