vanilla.bean

Obligatory Sinatra style (but concurrent!) micro-web framework for Vanilla.


License
MIT
Install
pip install vanilla.bean==0.1.1

Documentation

Vanilla Welcome to Vanilla Bean!

Obligatory Sinatra style (but concurrent!) micro-web framework for Vanilla.

Example

h = vanilla.Hub()
b = h.bean(port=8000)

@b.get('/')
def index(request):
    response = request.reply()
    response.send('Hello ')
    h.sleep(1000)
    response.send('World\n')
terminal

Websockets

h = vanilla.Hub()
b = h.bean(port=8000)

@b.websocket('/echo')
def echo(ws):
    while True:
        ws.send(ws.recv())

Installation

pip install vanilla.bean