Skip to content

Commit

Permalink
add a server app
Browse files Browse the repository at this point in the history
  • Loading branch information
nwaughachukwuma committed Nov 1, 2024
1 parent f746412 commit ed84dd4
Show file tree
Hide file tree
Showing 45 changed files with 37 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
fastapi
pydantic
fastapi-utilities
uvicorn
gunicorn

streamlit
httpx
Expand Down
Empty file added server/src/__init__.py
Empty file.
33 changes: 33 additions & 0 deletions server/src/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from contextlib import asynccontextmanager

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware


@asynccontextmanager
async def lifespan(_app: FastAPI):
# ---
yield
# ---


app = FastAPI(
title="Audiora API",
description="Listen to anything, anytime, leveraging AI-generated audio.",
version="1.0.0",
lifespan=lifespan,
)

app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
expose_headers=["*"],
)


@app.get("/")
async def root():
return {"message": "Hello World"}

0 comments on commit ed84dd4

Please sign in to comment.