Tuan-Anh Tran

Pretender - a mock server library

Posted on January 9, 2015  •  1 minutes  • 51 words

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.

var server = new Pretender(function(){
  this.put('/api/songs/:song_id', function(request){
    return [202, {"Content-Type": "application/json"}, "{}"]

Very easy to use for quick prototyping.

Follow me

Here's where I hang out in social media