Files
eventspace/backend/app/main.py
Felipe Cardoso 1d00b092fd Add initial setup for frontend and backend
This commit includes configurations and boilerplate code for both frontend and backend. The frontend uses Next.js with Tailwind CSS, while the backend is built with FastAPI. Various essential files like `tsconfig.json`, `requirements.txt`, and `.gitignore` have been added to kickstart the development process.
2025-02-27 12:50:35 +01:00

37 lines
869 B
Python

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import HTMLResponse
from app.config import settings
app = FastAPI(
title=settings.PROJECT_NAME,
version=settings.VERSION,
openapi_url=f"{settings.API_V1_STR}/openapi.json"
)
# Set up CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=settings.BACKEND_CORS_ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/", response_class=HTMLResponse)
async def root():
return """
<html>
<head>
<title>EventSpace API</title>
</head>
<body>
<h1>Welcome to EventSpace API</h1>
<p>Explore the available endpoints and documentation:</p>
<a href="/docs">OpenAPI Documentation</a>
</body>
</html>
"""