As mentioned in the documention, don't use Python's simple HTTPServer in production. Have a look at django instead: https://www.djangoproject.com/.
This repository contains python code for demostrating on how to control Raspberry Pi GPIO via a simple http server implemented using python standard library http.server. The http.server library allows ...