Metadata-Version: 2.0
Name: nanohttp
Version: 0.1.0.dev0
Summary: A very micro http framework.
Home-page: http://github.com/pylover/nanohttp
Author: Vahid Mardani
Author-email: vahid.mardani@gmail.com
License: WTFPL
Platform: UNKNOWN
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Development Status :: 4 - Beta
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development
Requires-Dist: pymlconf

nanohttp
========

A very micro HTTP framework.

Install
-------

PyPI
^^^^

..  code-block:: bash

    $ pip install nanohttp


Source
^^^^^^

..  code-block:: bash

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


Quick Start
-----------

``demo.py``

..  code-block:: python

    from nanohttp import Controller, action, context

    class Root(Controller):

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


..  code-block:: bash

    $ nanohttp demo

Or

..  code-block:: python

    from nanohttp import quickstart

    quickstart(Root())


Command Line Interface
----------------------

..  code-block:: bash

    $ nanohttp -h

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

    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.


