Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BLM16-MicroServer-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BLM16_MicroServer-1.0.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file BLM16-MicroServer-1.0.0.tar.gz.

File metadata

  • Download URL: BLM16-MicroServer-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for BLM16-MicroServer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ef089c6c40bec980920eee0ef8a53ab402ee92c08314d3471878f7e0b8c7e190
MD5 114408ac08fa7f148c7fd5ff7b9d8710
BLAKE2b-256 0f329986ff0ab726af9e518368e64eec45df79cacbb386be679669a149baa674

See more details on using hashes here.

File details

Details for the file BLM16_MicroServer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for BLM16_MicroServer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba9bfcabc5e0bafff96eb8de4c06f66d546989582f513adb435df40f8c8ba896
MD5 05da7f04aa7642d2bbd21fe7f09927d9
BLAKE2b-256 328560e9e239de9520fb3664e63a070f3b1533767689b007e30d7ce51998fbc4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page