sariina / mina

Imitates HTTP requests and responses of a chosen host

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mina

Build Status

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.

Install

go get -u github.com/sariina/mina

Example

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.

Options

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

Why mina?

Mina is named after the Myna bird (Persian: مرغ مینا), renowned for their ability to imitate speech.

About

Imitates HTTP requests and responses of a chosen host

License:MIT License


Languages

Language:Go 99.8%Language:Makefile 0.2%