Files
papi-py/papi.py
stephen schuresko b9bf105939
All checks were successful
Build and Push to Private Registry101 / build (push) Successful in 33s
feat: update Dockerfile and Makefile for improved deployment; add integration testing instructions and version endpoint
2025-02-18 08:29:31 -05:00

33 lines
724 B
Python

#!/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
from sqlalchemy.engine import URL
from sqlalchemy.orm import sessionmaker, Session, declarative_base
import db
import users
import posts
import os
db.Base.metadata.create_all(bind=db.engine)
app = FastAPI()
app.include_router(users.router)
app.include_router(posts.router)
@app.get("/")
async def root():
return {"message": "Hello World"}
@app.get("/version")
async def ver():
return {"version":db.version}