Mina saves API server responses to disk and serves them with its own HTTP server. Some use cases include:
- working with the API server when you or the server is offline
- each request costs money
- API server forces rate limits
- etc.
go get -u github.com/sariina/mina
Start a mina server for Github API on port 8080:
mina -addr=:8080 -target=https://api.github.com
In your client/broweser/app, instead of sending a request to
https://api.github.com/users/sariina
send it to
http://localhost:8080/users/sariina
Voila, the same response. The response is saved to your disk. Your app will think that you are using Github API even when you are offline.
mina --help
Usage:
mina -addr=<addr> -target=<target> [-o=<dir>] [-H=<header>] [-log=<logfile>]...
Options:
-addr address to listen to
-target target to route to
-H [optional] custom header
-o [optional] cache dir
-log [optional] log file
Example:
mina -addr=:8080 -target=https://www.domain.com:9000
Mina is named after the Myna bird (Persian: مرغ مینا), renowned for their ability to imitate speech.