-
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
Showing
2 changed files
with
11 additions
and
4 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -51,7 +51,7 @@ async def lifespan(app: FastAPI): | |
"icon": "🎯", | ||
"css": [ | ||
"https://unpkg.com/[email protected]/normalize.css", | ||
"https://cdn.jsdelivr.net/npm/water.css@2/out/water.css" | ||
"https://cdn.jsdelivr.net/npm/water.css@2/out/water.css", | ||
], | ||
} | ||
|
||
|
@@ -306,7 +306,8 @@ async def http_exception_handler(request: Request, exc: HTTPException): | |
) | ||
|
||
|
||
if __name__ == "__main__": | ||
# test mode | ||
def test_mode(): | ||
""" | ||
If running python_web_io/main.py directly (instead of via uvicorn with an entrypoint), accept CLI arguments. | ||
Ideal for quickly testing capabilities without creating `.envrc` or `.pythonwebio/config.toml` files. | ||
|
@@ -321,7 +322,6 @@ def parse_command_line_arguments(): | |
parser.add_argument( | ||
"--script", | ||
type=str, | ||
default="default_value1", | ||
help="Set the python script (override `config.toml` settings) (format: e.g.:`path/to/file.py:main`).", | ||
) | ||
parser.add_argument( | ||
|
@@ -344,3 +344,7 @@ def parse_command_line_arguments(): | |
app.state.config_path = args.config | ||
|
||
uvicorn.run(app, host=args.host, port=args.port) | ||
|
||
|
||
if __name__ == "__main__": | ||
test_mode() |