Oh no, backend is down!!
Repeat After Me is a Chrome extension allowing frontend developers to work when their backend server is down or unreachable by just replaying recorded responses.

When you are a frontend developer, nothing is worse than loosing access to backend, because you are immediately out of work, and there is nothing you can do about it.
It might occur in many situations.
Sometimes, you just don’t have any Internet connection, like when you are in train with no wifi, or visiting your in-law’s far away in the countryside.
Or sometimes, your connection is just fine, but the backend is down, and if you ask why, you will be told many things like “the migration takes longer than expected”, or “re-indexation failed”, or “there is something wrong on docker”, yeah… you know, backend developers, right? (we cannot trust those people anyway, they are not like us, really, they think JavaScript is not a programming language, but they love Shell, so I mean… I have even heard that some of them sleep with their eyes open, and they have cold blood and no navel, it might be just a rumor, but still…).
If you are lucky enough, you might be able to run your backend locally, but it is not always possible, like when nothing works unless you run 56 docker containers simultaneously, and then you do not have any CPU left to run Webpack…
And the most upsetting thing about that is you do not really need a fully working backend, answering any request perfectly. What you need most part of time is just something which works a little bit. When you build an auto-complete field for instance, as far as you get a server answer with the proper JSON format, any list of suggested words will do even if it is not totally accurate, at least you can move on and implement the field properly.
That’s why I have developed Repeat After Me.

In record mode, this Chrome extension will record any XHR call, storing the request parameters (URL, method, headers) and the corresponding response (status, body, length). All the requests are indexed and associated with a context name (so you can save requests corresponding to different apps).
Then in replay mode, each time your application will make an XHR call, Repeat After Me will return the best match:
- exact match: if the very same request has been recorded, it returns its response,
- simple match: if no exact match, it will search a request with same method and same path (ignoring the querystring),
- near match: and if you are still unlucky, it will search a request with same method and a similarly ended path, for instance if the app calls
POST http://mybackend/task1/complete, the extension might return the recorded response forPOST http://mybackend/task2/complete.
When the backend is reachable, you can record few regular use cases with your app in order to collect a good sample of requests. And when it is not, or when you are offline, those requests can be reused to fulfill any similar use cases!
For now it is just a first version, I am pretty sure it can be improved in many way. Suggestions are welcome!
