pretender.js is a mock server library.
Pretender is a mock server library in the style of Sinon (but built from microlibs. Because JavaScript) that comes with an express/sinatra style syntax for defining routes and their handlers.
Pretender will temporarily replace the native XMLHttpRequest object, intercept all requests, and direct them to little pretend service you've defined.
Github Link: https://github.com/pretenderjs/pretender