# example.py
from pycnic.core import WSGI, Handler
class Hello(Handler):
def get(self, name="World"):
return { "message":"Hello, %s!"%(name) }
class app(WSGI):
routes = [
('/', Hello()),
('/([\w]+)', Hello())
]
Now that Pycnic is available on PyPI, it may be installed with pip.
pip install pycnic
Pycnic may be ran with any WSGI-compliant server, such as Gunicorn.
gunicorn file:app