aboutsummaryrefslogtreecommitdiff
path: root/backend/server.py
blob: a00ab7f1f58315484f352320f0221e95220965bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python3

import sys
from wsgiref.simple_server import make_server
from tilo import application

usageInfo = f"""
Usage: {sys.argv[0]}

Runs a basic dev server that serves a WSGI script
"""
if len(sys.argv) > 1:
	print(usageInfo, file=sys.stderr)
	sys.exit(1)

with make_server('', 8000, application) as httpd:
    print("Serving HTTP on port 8000...")
    httpd.serve_forever()