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.
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 09:18:20 +01:00
|
|
|
from lantern.route import main_route
|
2017-04-11 09:25:54 +01:00
|
|
|
import os
|
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 09:34:07 +01:00
|
|
|
workers = os.cpu_count() or 1
|
2017-04-11 09:18:20 +01:00
|
|
|
app.add_route(main_route, "/<path>")
|
|
|
|
app.add_route(main_route, "/")
|
2017-04-11 09:25:54 +01:00
|
|
|
app.run(host="0.0.0.0", port=8000, workers=workers)
|