Mock-RESTful

A tiny nodejs module for development purposes: it parses json files and creates a server that responds to routes created on the basis of the json data, therefore simulating your real life REST api. It follows the conventions delineated on Wikipedia for Representational State Transfer and, oyez oyez, it’s stateful! So you can post or put new data and find them there at the next call. Until you restart the application, that is. There’s no database, and no external dependencies. The idea is that you use it to develop the front end while your service is not ready yet, and then you throw it away and it leaves no trace. For this very reason I’ve avoided even libraries that would have been nice to have in this particular instance, like when.js (admittedly my own version of when/parallel behaviour is, if simple, rather uncouth) and Express. But well, it’s fit for purpose and has full test coverage. Enjoy.

npmjs.org/package/mock-restful

Leave a comment

Your email address will not be published. Required fields are marked *


3 × eight =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>