Skip to main content

Simple async wrapper to python http server

Project description

Async Http Server

The simplest async python http server library.

Example

import asyncio
from asyncbasehttp import request_handler, Request, Response

@request_handler
async def handle_request(req: Request):
    return Response.create_ok_response(f'You requested path: {req.path}'.encode())


async def main():
    server = await asyncio.start_server(handle_request, port=8000)
    print("http://localhost:8000")
    await server.serve_forever()

asyncio.run(main())

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

asyncbasehttp-1.0.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

asyncbasehttp-1.0-py3-none-any.whl (10.7 kB view hashes)

Uploaded Python 3

Supported by

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