-
-
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
19 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import os | ||
from contextlib import asynccontextmanager | ||
|
||
import uvicorn | ||
from fastapi import FastAPI | ||
from fastapi.exception_handlers import http_exception_handler, request_validation_exception_handler | ||
from fastapi.exceptions import HTTPException, RequestValidationError | ||
|
@@ -46,7 +47,7 @@ def _create_app() -> FastAPI: | |
title="Wigglecam Node API", | ||
description="API may change any time.", | ||
version=__version__, | ||
contact={"name": "mgineer85", "url": "https://github.com/photobooth-app/photobooth-app", "email": "[email protected]"}, | ||
contact={"name": "mgineer85", "url": "https://github.com/photobooth-app/wigglecam", "email": "[email protected]"}, | ||
docs_url="/api/doc", | ||
redoc_url=None, | ||
openapi_url="/api/openapi.json", | ||
|
@@ -72,3 +73,19 @@ async def validation_exception_handler(request, exc): | |
|
||
|
||
app = _create_app() | ||
|
||
|
||
def main(): | ||
# to allow api is runnable via project.scripts shortcut | ||
# ref: https://stackoverflow.com/a/70393344 | ||
uvicorn.run( | ||
app, | ||
host="0.0.0.0", | ||
port=8000, | ||
reload=False, | ||
log_level="debug", | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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