Switches the webserver over to Granian

This commit is contained in:
Trenton H
2025-02-14 11:22:57 -08:00
parent 628d85080f
commit 9d07810caf
6 changed files with 78 additions and 56 deletions

16
webserver.py Normal file
View File

@@ -0,0 +1,16 @@
import os
if __name__ == "__main__":
from granian import Granian
from granian.constants import Interfaces
Granian(
"paperless.asgi:application",
interface=Interfaces.ASGI,
address=os.getenv("PAPERLESS_BIND_ADDR", "::"),
port=int(os.getenv("PAPERLESS_PORT", 8000)),
workers=int(os.getenv("PAPERLESS_WEBSERVER_WORKERS", 1)),
websockets=True,
# TODO, test this
url_path_prefix=os.getenv("PAPERLESS_FORCE_SCRIPT_NAME"),
).serve()