-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
82 lines (61 loc) · 2.05 KB
/
Copy pathexample.py
File metadata and controls
82 lines (61 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from minicli import cli, run
from waitress import serve
import threading
@cli
def routing(host: str="0.0.0.0", port: int=8000):
from routing.app import app
app.events.lifecycle.on_init.send('startup')
serve(app, listen=f"{host}:{port}")
@cli
def traject(host: str="0.0.0.0", port: int=8000):
from traject.app import app
app.events.lifecycle.on_init.send('startup')
serve(app, listen=f"{host}:{port}")
@cli
def zodb(host: str="0.0.0.0", port: int=8000):
from zodb.app import app
app.events.lifecycle.on_init.send('startup')
serve(app, listen=f"{host}:{port}")
@cli
def zodb_async(host: str="0.0.0.0", port: int=8000):
from zodb_async.app import app
app.events.lifecycle.on_init.send('startup')
serve(app, listen=f"{host}:{port}")
@cli
def graphql(host: str="0.0.0.0", port: int=8000):
from gql.app import app
app.events.lifecycle.on_init.send('startup')
serve(app, listen=f"{host}:{port}")
@cli
def upload(host: str="0.0.0.0", port: int=8000):
from fileupload.app import app
app.events.lifecycle.on_init.send('startup')
serve(app, listen=f"{host}:{port}")
@cli
def websockets(host: str="0.0.0.0", port: int=8000):
from ws.app import app, websocket_runner
app.events.lifecycle.on_init.send('startup')
wst = threading.Thread(target=websocket_runner)
wst.daemon = True
wst.start()
serve(app, listen=f"{host}:{port}")
@cli
def all(host: str="0.0.0.0", port: int=8000):
from wolf.app.nodes import Mapping
from routing.app import app as routing_app
from fileupload.app import app as upload_app
from gql.app import app as graphql_app
from zodb.app import app as zodb_app
from traject.app import app as traject_app
app = Mapping({
"/routing": routing_app,
"/upload": upload_app,
"/graphql": graphql_app,
"/traject": traject_app,
"zodb": zodb_app,
})
for subapp in app.values():
subapp.events.lifecycle.on_init.send('startup')
serve(app, listen=f"{host}:{port}")
if __name__ == '__main__':
run()