REST API for rsps userdata

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.

Download link

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:

Very nice! I love mongo personally, this is great.

Thanks! And as do I :slight_smile:

As you may have read on another thread of mine which you replied on (this one), I am planning to develop a The Hunger Games-esque server.
When I do this, I’ll make sure to save the user’s data this way. Also I’ll probably implement highscores this way.
Perhaps I could even make the server read the required data (as dialogues etc) from the REST API whilst starting up?

Was this your first node project? It’s a trivial thing none the less but good job.