34 lines
653 B
Python
34 lines
653 B
Python
from fastapi import FastAPI
|
|
from .database import engine
|
|
from . import models
|
|
from .routers import payment
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from config import load_config
|
|
|
|
|
|
ApplicationConfig = load_config()
|
|
|
|
|
|
models.Base.metadata.create_all(bind=engine)
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
# print(ApplicationConfig.origins)
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=ApplicationConfig.origins,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
|
|
|
|
app.include_router(payment.router, prefix="/api", tags=["payment"])
|
|
|
|
|
|
|
|
@app.get("/")
|
|
def read_root():
|
|
return {"message": "Welcome to the HVAC Payment API"} |