https://github.com/flpvsk/koa.py
Koa javascript framework port to python. Based on asyncio.
https://github.com/flpvsk/koa.py
Last synced: 16 days 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 (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-13T15:33:03.000Z (about 11 years ago)
- Last Synced: 2025-10-14T15:40:02.670Z (16 days ago)
- Language: Python
- Size: 201 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Koa.py
[](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 nxt
if __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