Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.
/ lag Public archive

🐢 mock server to simulate slow third-party (external) API connections

Notifications You must be signed in to change notification settings

kelvintaywl/lag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lag

mock server to simulate slow / delayed responses from third-party or external APIs.

try: https://laggard.herokuapp.com/delay/3000 to simulate a response that takes 3 seconds.

Detailed API usage

Supports POST, GET methods on /delay/[time to delay in milliseconds].

Returns ping pong (Content Type: plain/text) by default.

If you wish to get a specific JSON response, send it as a JSON body in request.

$ time curl -X post https://laggard.herokuapp.com/delay/3000 -d '{"hello": "world"}'

{
    "hello": "world"
}

real	0m4.439s
user	0m0.056s
sys	0m0.070s

Installing locally

Requires Python 3.6+

$ pip install -r requirements.txt
$ python server.py --port 8090

Running with Docker

Dockerfile is provided as-is, so you may wish to simply build an image and pass the desired port number as env var.

docker build -t kelvintaywl/lag .
docker run -e PORT=80 -p 8090:80 -i kelvintaywl/lag

About

🐢 mock server to simulate slow third-party (external) API connections

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages