Skip to content

Instantly share code, notes, and snippets.

@stwiname
Last active February 22, 2017 23:33
Show Gist options
  • Save stwiname/1e7a013541cf34f40301bb78ad7f8f2f to your computer and use it in GitHub Desktop.
Save stwiname/1e7a013541cf34f40301bb78ad7f8f2f to your computer and use it in GitHub Desktop.

HTTP Queue

The aim is to write a simple http server with methods to use a queue.

Methods

These methods should be implemented:

  • POST /queue/pop - Should pop from the queue and return the pushed JSON object with an ID and created time added
  • POST /queue/push - Should submit a JSON object to the server and push it to the queue. The response should be a JSON object with the id
  • GET /queue/count Should return the size of the queue in a JSON object

Technologies

Please use these technologies:

Feel free to use any NodeJs libraries that you find suitable.

Bonus (not necessary)

Submission

Please tell us how long this took and submit either a link to a public git repo or a zip file with the project (excluding output files and the node_modules directory).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment