
All checks were successful
Deploy Dev / Build (pull_request) Successful in 11s
Deploy Dev / Push (pull_request) Successful in 31s
Deploy Dev / Deploy dev (pull_request) Successful in 12s
Deploy Prod / Build (pull_request) Successful in 5s
Deploy Prod / Push (pull_request) Successful in 7s
Deploy Prod / Deploy prod (pull_request) Successful in 7s
28 lines
657 B
Python
28 lines
657 B
Python
import fastapi
|
|
import uvicorn
|
|
|
|
from app.routers import take
|
|
from app.routers import put
|
|
from app.routers import finish
|
|
|
|
from app.storage import mongo
|
|
|
|
|
|
app = fastapi.FastAPI(debug=True)
|
|
|
|
app.include_router(take.router)
|
|
app.include_router(put.router)
|
|
app.include_router(finish.router)
|
|
|
|
@app.exception_handler(Exception)
|
|
async def unicorn_exception_handler(request: fastapi.Request, exc: Exception):
|
|
return fastapi.JSONResponse(
|
|
status_code=500,
|
|
content={"message": f"Oops! {exc.name} did something. There goes a rainbow... {exc}"},
|
|
)
|
|
|
|
mongo.create_indexes()
|
|
|
|
if __name__ == '__main__':
|
|
uvicorn.run(app, host="0.0.0.0", port=1239)
|