14 comments

[ 0.67 ms ] story [ 43.8 ms ] thread
For people learning to develop with client side frameworks having a real data source is very helpful.
This is a really nice approach to the problem of getting fake data. For the lazy, it responds with your request data if you have any. Super useful if you just want to get parsing with a real response.

I'd like to point out though, as I always do when things like this, I'm in the maintainer of a similar project which isn't hosted but is an open source node project: http://github.com/basicallydan/interfake - if you wanna do a similar thing but make responses more explicit. About the same amount of work up front, but you don't specify responses in requests.

Anyway, nice one Ben!

I've been looking for something like interfake for a few weeks, so thanks for creating it! We've just been loading JSON from the file-system directly, but this will be much much nicer :)
This is a good idea. But I prefer to building a local mock server for my client-side ajax support. There so many tools you can use so it's not a complicated task. Usually, I use Grunt to build a local server to response mock data to requests.
This is a good idea. But I prefer to building a local mock server for my client-side ajax requests. There so many tools you can use so it's not a complicated task. Usually, I use Grunt to build a local server to response mock data to requests.
Does it have websocket support?
am i missing something? i can't find where it tells how to craft the response.
You can't. Looks like the response is hard-coded.

Would be nice to be able to customize keys, choose a format for a list of a resource, etc. so that if you use this in development you don't need to make changes for your "real" API if you have different standards.

Can someone please explain why this is useful? (Just curious. I’m sure it is useful, I just can't see how ^^)
It would be great for learning client-side development using React, AngularJS, etc. without having to use an existing API or building one yourself.
Imagine the frontend and backend teams are large and do not work closely. This allows the frontend to easily test their code without waiting for the backend team to implement the specific api. Even better that it allows them to test with actual http request/responses instead of just hardcoding data.