r/TheNewWayToPlay • u/kamnxt Moderator • May 04 '15
Official [Javascript / Node.js] Server side coding challenge!
Want to code the server? Here's a challenge for you!
Write a REST API in Node.js that has the following endpoints:
- localhost:9002/rest/projectname - returns a JSON object: {project: "projectFusion"}
- localhost:9002/rest/postnumber - post {number: <a number>} to save it to a variable
- localhost:9002/rest/getnumber - returns {number: <the number set by postnumber>}
Here's a simple client that tests if your program works correctly (feel free to examine it to make sure your program works correctly).
https://gist.github.com/kamnxt/0012812f975dbb0b26b6
It gets the projectname, sets the number to a random number, gets the number and checks if it's the same. If you write a program that passes the test, send a PM. If there's something more you want to know, just comment below and I'll try to answer as quickly as possible
-kamnxt
View all comments
Show parent comment
1
u/kamnxt Moderator May 05 '15
Well, TurboLua seems pretty nice. I'm not sure if we have enough people here who know it as well as node.js, but I'm probably going to experiment a bit with it. Do you want to join the server coding group? (we're probably use node.js, though if enough people want we could use TurboLua).