doge4web

A functional asyncio-based web framework.

Simple

import '/dogeweb'
import '/dogeweb/r'
import '/dogeweb/property'

app = dogeweb.app $ r.path
  '/',   ~> 'Hello, World!'
  '/u/', ~> 'Hello, Universe!'

if __name__ == "__main__" => app.run '0.0.0.0' 8000

Modern

wssrv = r.upgrade
  'http', ~> @abort 405
  'websocket', websocket.endpoint $ io ~>
    outputs.add io
    except
      err => while True =>
        msg = yield from io
        msg.is_data => for o in outputs => yield from $ o.data msg
      finally => outputs.remove io

Fast

# yoboard @ gunicorn+flask:
$ wrk -c 50 -t 5 -d 30 http://127.0.0.1:8001/
Requests/sec:   3745.77
# yoboard @ gunicorn+dogeweb:
$ wrk -c 50 -t 5 -d 30 http://127.0.0.1:8002/
Requests/sec:   6328.94

Read the docs | Read the code

pip install https://github.com/pyos/dogeweb/archive/master.zip