Lo recuerdo (yo no tengo derecho a pronunciar ese verbo sagrado, sólo un hombre en la tierra tuvo derecho y ese hombre ha muerto) con una oscura pasionaria en la mano, viéndola como nadie la ha visto, aunque la mirara desde el crepúsculo del día hasta el de la noche, toda una vida entera.
Jorge Luis Borges - Funes, el memorioso
Funes
funes is a server to mock API responses. You might use it to:
- test applications without hitting production resources;
- create integrations tests for your applications;
Installation
To install funes, you must have rust and cargo installed. Then you can run:
Usage
Now you can run your funes server in one terminal and make requests from another one:
# terminal 1
To mock the requests of an {api}
, call the endpoint
http://localhost:8080/{api}
. The first request will hit the {api}
and then
store the response:
# terminal 2
# terminal 1
The second request and all the subsequent ones will be served from the stored response:
# terminal 2
# terminal 1
Posts are supported:
# terminal 2
# terminal 1
Endpoints
These are the endpoints of a funes app:
localhost:8080/{api}
- Likelocalhost:8080/pokeapi.co/api/v2/pokemon/1
localhost:8080/mocks
- List of all saved mockslocalhost:8080/health
localhost:8080/resource-status
Default Envs
FUNES_ALLOW_EXTERNALS=true
FUNES_API_REGEX=".+"
FUNES_APP=funes
FUNES_HOST=0.0.0.0:8080
FUNES_LATENCY_COLLECTION=""
FUNES_LOG=funes,actix_web=info
FUNES_MOCK_DIR=
/.funes
Examples
All examples can be found in the examples folder:
Benchmarks
Funes is built on top of actix and is blazing fast! Take a look:
# https://github.com/wg/wrk