archive
/
lantern
Archived
1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
lantern/lantern/main.py

16 lines
396 B
Python
Raw Normal View History

2017-04-11 08:56:47 +01:00
from sanic import Sanic
2017-04-11 09:30:30 +01:00
from sanic_useragent import SanicUserAgent
2017-04-11 21:27:19 +01:00
from lantern.args import parse_args
from lantern.route import build_main_route
2017-04-11 08:56:47 +01:00
2017-04-11 09:20:59 +01:00
app = Sanic(__name__)
2017-04-11 09:30:30 +01:00
SanicUserAgent.init_app(app)
2017-04-11 09:01:04 +01:00
2017-04-11 08:56:47 +01:00
def main():
2017-04-11 21:27:19 +01:00
args = parse_args()
main_route = build_main_route(args)
2017-04-11 09:18:20 +01:00
app.add_route(main_route, "/<path>")
app.add_route(main_route, "/")
2017-04-16 10:46:59 +01:00
app.run(host="0.0.0.0", port=args.port)