Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flpvsk/koa.py
Koa javascript framework port to python. Based on asyncio.
https://github.com/flpvsk/koa.py
Last synced: about 1 month ago
JSON representation
Koa javascript framework port to python. Based on asyncio.
- Host: GitHub
- URL: https://github.com/flpvsk/koa.py
- Owner: flpvsk
- Created: 2014-02-14T13:59:58.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-13T15:33:03.000Z (over 10 years ago)
- Last Synced: 2024-04-14T20:21:11.349Z (9 months ago)
- Language: Python
- Size: 201 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Koa.py
[![Build
Status](https://drone.io/github.com/filipovskii/koa.py/status.png)](https://drone.io/github.com/filipovskii/koa.py/latest)Web framework, inspired by [koa.js][koajs].
Started for exploring capabilities of python [asyncio][asyncio] framework.
Requires python 3.3 or higher.
Example:
import asyncio
from koa import Application@asyncio.coroutine
def set_status(ctx, nxt):
ctx.response.status = 200
yield from nxt
print('After write_body')@asyncio.coroutine
def write_body(ctx, nxt):
ctx.response.write('Hi, you\'ve reached {}'.format(ctx.request.url))
yield from nxtif __name__ == '__main__':
app = Application()
app.use(set_status)
app.use(write_body)app.listen(8000)
[koajs]: http://koajs.com/
[asyncio]: http://docs.python.org/3.4/library/asyncio.html