feat: update Dockerfile and Makefile for improved deployment; add integration testing instructions and version endpoint
All checks were successful
Build and Push to Private Registry101 / build (push) Successful in 33s
All checks were successful
Build and Push to Private Registry101 / build (push) Successful in 33s
This commit is contained in:
17
papi.py
17
papi.py
@@ -1,4 +1,11 @@
|
||||
#!/bin/env python3
|
||||
#
|
||||
# author: Stephen Schuresko
|
||||
# date: 2025-02-18
|
||||
# file: papi.py
|
||||
# description: A simple FastAPI app (papi) with a few routes and models for users and posts
|
||||
#
|
||||
|
||||
from fastapi import FastAPI, Depends
|
||||
import uvicorn
|
||||
from sqlalchemy import create_engine, Column, Integer,String, ForeignKey
|
||||
@@ -7,6 +14,7 @@ from sqlalchemy.orm import sessionmaker, Session, declarative_base
|
||||
import db
|
||||
import users
|
||||
import posts
|
||||
import os
|
||||
|
||||
|
||||
|
||||
@@ -19,9 +27,6 @@ app.include_router(posts.router)
|
||||
async def root():
|
||||
return {"message": "Hello World"}
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run("papi:app", host="0.0.0.0", port=8912, reload=True, log_level="debug",
|
||||
workers=5, limit_concurrency=10, limit_max_requests=100)
|
||||
|
||||
@app.get("/version")
|
||||
async def ver():
|
||||
return {"version":db.version}
|
||||
|
||||
Reference in New Issue
Block a user