simple http server (python)
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
mockserver
.gitignore
README.md
server.py

README.md

Simple http server written in python that is supposed to be used for mocking services.

  • Starting server
python server.py

Server starts on port 8000, this can be changed by changing server.py file.

  • Adding/editing end points

Modify mockserver/config.py by creating function(s) that will accept one argument, which is BaseHTTPRequestHandler (check python documentation for more info) Then create mappings variable which is dict of dicts. First dictionary holds keys (urls without trailing forward slash) and value is dictionary where key is http request method (GET, POST etc.) and value is function that should get called.