Skip to content

Commit

Permalink
ci: deploy api
Browse files Browse the repository at this point in the history
  • Loading branch information
montoyaobeso committed Jun 10, 2024
1 parent 2718fa6 commit 3ea0909
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions server.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,44 @@
import fastapi, uvicorn
from fastapi.responses import JSONResponse
import os
import uvicorn
from dotenv import load_dotenv
from fastapi import FastAPI

api = fastapi.FastAPI()
load_dotenv()


@api.get("/")
async def root():
"""Get a welcome messge from the API."""
return JSONResponse(
content={"message": "Welcome to transactions email generator API."},
status_code=200,
)
from src.api.routers import (
account,
load_transactions,
load_transactions_s3,
presiged_url,
root,
send_balance,
transaction,
)

app = FastAPI(
title="Transactions Email Generator",
description="Manage accounts, transactions and send balances to registered email.",
version="0.0.1",
contact={
"name": "Abraham Montoya",
"email": "montoyaobeso@gmail.com",
},
)

app.include_router(root.router)
app.include_router(account.router)
app.include_router(transaction.router)
app.include_router(presiged_url.router)
app.include_router(load_transactions.router)
app.include_router(load_transactions_s3.router)
app.include_router(send_balance.router)

...

if __name__ == "__main__":
print("Starting webserver...")
uvicorn.run(
api,
app,
host="0.0.0.0",
port=int(os.getenv("PORT", 8080)),
log_level=os.getenv("LOG_LEVEL", "info"),
Expand Down

0 comments on commit 3ea0909

Please sign in to comment.