don41382 / api-delay-simulator

A http endpoint to simulate long lasting requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

api-delay-simulator

current build status

A http server, which accepts http requests with a given delay to simulate long lasting http requests.

For example a request to the server:

$ curl -X GET http://localhost:3000/1500

will response after 1.5 seconds.

Installation & Support

There is no installation required. Just download the latest version from the current releases for your operating system.

Supported OS

  • Windows x86
  • Linux
  • macOS (Intel)

Installation on macOS with Brew

$ brew tap don41382/api-delay-simulator
$ brew install api-delay-simulator

how to run

Just execute the downloaded binary, e.g. for Windows

$ api-delay-simulator.exe --help
Starts an api server, which will response to requests with a given delay.

In example, a GET request to http://localhost:3000/1000 will response after 1 second.

Usage: api-delay-simulator [PORT]

Arguments:
  [PORT]  [default: 3000]

Options:
  -h, --help     Print help
  -V, --version  Print version

development

Checkout the git project and run cargo.

$ cargo run

In order to build the api-delay-simulator for windows on mac, you'll have to do the following:

 $ brew install mingw-w64
 $ rustup target add x86_64-pc-windows-gnu
 $ cargo build --target=x86_64-pc-windows-gnu --release

About

A http endpoint to simulate long lasting requests


Languages

Language:Rust 100.0%