Skip to main content

A very micro http framework.

Project description

A very micro HTTP framework.



$ pip install nanohttp


$ cd path/to/nanohttp
$ pip install -e .

Quick Start

from nanohttp import Controller, action, context

class Root(Controller):

    def index(self):
        yield from ('%s: %s\n' % i for i in context.environ.items())
$ nanohttp demo


from nanohttp import quickstart


Command Line Interface

$ nanohttp -h

usage: nanohttp [-h] [-c CONFIG_FILE] [-b {HOST:}PORT] [-d DIRECTORY] [-V]

positional arguments:
  MODULE{:CLASS}        The python module and controller class to launch.
                        default: `nanohttp:Demo`, And the default value for
                        `:CLASS` is `:Root` if omitted.

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG_FILE, --config-file CONFIG_FILE
                        Default: nanohttp.yaml
  -b {HOST:}PORT, --bind {HOST:}PORT
                        Bind Address. default: 8080
  -d DIRECTORY, --directory DIRECTORY
                        The path to search for the python module, which
                        contains the controller class. default is: `.`
  -V, --version         Show the version.

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.

Files for nanohttp, version 0.1.0.dev0
Filename, size File type Python version Upload date Hashes
Filename, size nanohttp-0.1.0.dev0-py3-none-any.whl (7.7 kB) File type Wheel Python version 3.5 Upload date Hashes View
Filename, size nanohttp-0.1.0.dev0.tar.gz (5.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page