Skip to content

Is there a way to run Granian programmatically instead of from bash shell? #254

Answered by gi0baro
DavydLiu asked this question in Q&A
Discussion options

You must be logged in to vote

Adapting your snippet:

import granian

async def app(scope, receive, send):
    ...

granian.Granian("main:app", interface="asgi", port=5000, log_level="info").serve()

You can check Granian class for further needs.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DavydLiu
Comment options

Answer selected by DavydLiu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants