Skip to content

Instantly share code, notes, and snippets.

@loomsen
loomsen / simple_server.py
Last active January 19, 2020 10:57 — forked from dfrankow/simple_server.py
Simple HTTP REST server in python3
#!/usr/bin/env python
"""A simple HTTP server with REST and json for python 3.
addrecord takes utf8-encoded URL parameters
getrecord returns utf8-encoded json.
Usage examples:
$ python http-server-post-get.py 8080 127.0.01
#!/bin/bash
# -------------------------------------------------------------------
# Constants
# -------------------------------------------------------------------
PROGNAME=$(basename $0)
VERSION="0.0.1"
## FIXME:Where do you want to place the file?
HWINFO=$PWD/$HOSTNAME.rtf