8000 GitHub - pablote/mock-http-server: Runtime configurable HTTP mock server
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pablote/mock-http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Mock Server

Simple, fast, runtime configurable HTTP mock server.

Unlike most similar mock servers, you can change what a specific URL returns at runtime. So you can point your application to a fixed URL, and try different responses in time.

Running

docker run -d -p 9090:9090 pablote/mock-http-server

Usage

Just GET any URL and you'll get a default response with status code 200 and empty body:

GET /foo/bar

To change what a specific URL returns, GET the URL with special query params:

  • Change /foo/bar to return hello world in the body

GET /foo/bar?__body=hello%20world

  • Change /foo/bar/ status code to 500

GET /foo/bar?__status=500

  • Change /foo/bar/ status code to return 200 60% percent of the time, then return 500 for the remaining 40%

GET /foo/bar?__status=60:200:500

TODOs

  • Support for all HTTP verbs beside GET
  • More overridable values like Content-Type
  • Preconfigure routes at startup? (easy workaround is a startup script that initializes routes with curl)

Build & Publish

  • docker build -t pablote/mock-http-server .
  • docker push pablote/mock-http-server:latest

About

Runtime configurable HTTP mock server

Topics

Resources

Packages

No packages published
0