-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chiara Rasi
committed
Feb 5, 2024
1 parent
c263195
commit e70c421
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import typer | ||
import uvicorn | ||
from schug.config import settings | ||
|
||
cli = typer.Typer() | ||
|
||
|
||
@cli.callback() | ||
def callback(): | ||
""" | ||
Welcome to the CLI | ||
""" | ||
|
||
|
||
@cli.command("serve") | ||
def serve_app(reload: bool = typer.Option(False, "--reload")): | ||
"""Start a dev server for the schug app""" | ||
typer.echo("Serving schug") | ||
app = "schug.main:app" | ||
uvicorn.run(app=app, host=settings.host, port=settings.port, reload=reload) |