Skip to main content

Simple aiohttp Server for both static and python/php file

Project description


This is a simple http async server which extends python -m http.server.
(WARN: It's not recommended for production environments, just use it in development or testing environments only!):

  • Support print to http response directly (same as php's echo)
  • Support async-await
  • Support php, python


pip install ahui-aiohttp-server
pip3 install ahui-aiohttp-server

Start server

$ tree .
$ python -m ahui_aiohttp_server
$ python -m ahui_aiohttp_server --host --port 5000

Access server

Access via echo server(php-like):

$ cat app/
print('Hello World!')

$ curl
Hello World!
$ curl
<js content>
$ curl
<js content>

If you want to get request data(such as: get, post, cookie, ..., use aiohttp_handler(request) instead:

$ cat app/
def aiohttp_handler(request):
    print(request.query)    # use print 

$ curl

Access via normal aiohttp server:

$ cat app/
from aiohttp import web
async def aiohttp_handler(request):
    data = await
    return web.Response(body=str(data)) # use return

$ curl - 'k1=v2'

Access static file:

$ curl
<js content>


  1. aiohttp
  2. python>=3.6

Project details

Download files

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

Files for ahui_aiohttp_server, version 0.1.16
Filename, size File type Python version Upload date Hashes
Filename, size ahui_aiohttp_server-0.1.16-py3-none-any.whl (3.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size ahui_aiohttp_server-0.1.16.tar.gz (3.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page