mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 00:05:21 +01:00
Feature: Switch webserver to granian (#9218)
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
parent
628d85080f
commit
654c9ca273
15 changed files with 106 additions and 341 deletions
19
webserver.py
Normal file
19
webserver.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
if __name__ == "__main__":
|
||||
import os
|
||||
|
||||
from granian import Granian
|
||||
from granian.constants import Interfaces
|
||||
|
||||
Granian(
|
||||
"paperless.asgi:application",
|
||||
interface=Interfaces.ASGI,
|
||||
address=os.getenv("GRANIAN_HOST") or os.getenv("PAPERLESS_BIND_ADDR", "::"),
|
||||
port=int(os.getenv("GRANIAN_PORT") or os.getenv("PAPERLESS_PORT") or 8000),
|
||||
workers=int(
|
||||
os.getenv("GRANIAN_WORKERS")
|
||||
or os.getenv("PAPERLESS_WEBSERVER_WORKERS")
|
||||
or 1,
|
||||
),
|
||||
websockets=True,
|
||||
url_path_prefix=os.getenv("PAPERLESS_FORCE_SCRIPT_NAME"),
|
||||
).serve()
|
||||
Loading…
Add table
Add a link
Reference in a new issue