Skip to content

fivehut/wsgidelegator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

wsgi Delegator

Delegate your request to multiple wsgi instances.

Usage

just wrap your instances in a dict

from bottle import Bottle
from wsgidelegator import Delegator
from wsgiref.simple_server import make_server


app1 = Bottle()
app2 = Bottle()


@app1.route('/')
def f():
    return 'test 1'

@app2.route('/')
def f():
    return 'test 2'

app = Delegator({ 'api': app1 }, default = app2)

httpd = make_server('localhost', 8089, app)
httpd.serve_forever()

reslut

$ curl localhost:8089/api
test 1

$ curl localhost:8089/other
test 2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages