Closed ZeN220 closed 3 months ago
As of today, there's no support for this in CLI. But you can run Granian via Python code and customise the target_loader
parameter of Granian.serve
.
Given your use-case, probably it's easier to write a run.py
file which runs the factory, eg:
from your_module import your_factory
app = your_factory()
and point Granian to run:app
. It might also be worth checking #35.
I didn't find any functionality similar to
--factory
from uvicorn. are there any plans to add such a thing? something like that:And running like this: