All checks were successful
Build and Push to Private Registry101 / build (push) Successful in 33s
33 lines
724 B
Python
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}
|