We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I didn't find any functionality similar to --factory from uvicorn. are there any plans to add such a thing? something like that:
--factory
def create_app(): app = MyAPP() return app
And running like this:
granian "module:create_app()"
The text was updated successfully, but these errors were encountered:
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.
target_loader
Granian.serve
Given your use-case, probably it's easier to write a run.py file which runs the factory, eg:
run.py
from your_module import your_factory app = your_factory()
and point Granian to run:app. It might also be worth checking #35.
run:app
Sorry, something went wrong.
No branches or pull requests
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:
granian "module:create_app()"
The text was updated successfully, but these errors were encountered: