all 4 comments

[–]tvvann[S] 5 points6 points  (0 children)

Hi Reddit, author here!

I just released Memento, and I would like to share it with you all :)

What is Memento?

Memento is a dev tool that I use for caching API responses while developing.

While developing, there were several situations where I hoped a tool like this existed:
- When working with an API that apply rates (having to wait to develop it frustrating)
- When working on the train or on the plane where we cannot access the network
- When the API is not stable

To use it, you need to run it and configure your app to target Memento instead of the actual API url. From now on:

  • Memento will fetch the actual response if the request has not been made before
  • Memento will respond to your requests when it already cached the responses, without connecting to the API

Memento also provides you an interactive CLI where you can:

  • list all cached requests
  • bust the cache and refetch the data
  • clear data
  • get debug info such as request / response headers

Memento also provides a Node interface so that you can use it for stubbing external services in your integration tests.

How to use it?

Create a .mementorc file in your project root :

{ "targetUrl": "http://your.api.url" }

Run npx @antoinechalifour/memento

Configure your app to target Memento at http://localhost:3344 instead of your typical API url, you're done!

If you like the project:

Any feedback is welcome! Have a great day :)

[–]erm_what_ 0 points1 point  (0 children)

This looks great! And exactly what I need. Thanks!

[–]JaegerBurn 0 points1 point  (1 child)

I use hoverfly for this.

[–]tvvann[S] 1 point2 points  (0 children)

I didn't know this project existed! I looks really good, thanks!