A lightweight and flexible webserver.
Project description
MicroServer
MicroServer is a lightweight Python webserver with minimal overhead and no external dependencies MicroServer provides complete flexibility by leaving all data processing and templating to the user.
from microserver import MicroServer, Response
server = MicroServer()
# Configures the route / to be handled by the home function.
@server.route('/')
def home():
data = server.load_view('index.html')
mime = 'text/html'
return Response(data, mime)
# Configures all 404 errors to be handled by the e404 function.
@server.errorhandler(404)
def e404():
data = server.load_view('404.html')
mime = 'text/html'
return Response(data, mime)
# Starts the server on the given host and port.
server.start('localhost', 8080)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for BLM16_MicroServer-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba9bfcabc5e0bafff96eb8de4c06f66d546989582f513adb435df40f8c8ba896 |
|
MD5 | 05da7f04aa7642d2bbd21fe7f09927d9 |
|
BLAKE2b-256 | 328560e9e239de9520fb3664e63a070f3b1533767689b007e30d7ce51998fbc4 |