added frontend and script examples

This commit is contained in:
CaffeineFueled 2025-04-15 23:33:44 +02:00
parent 368c4de6fe
commit 61b10a2bc2
6 changed files with 385 additions and 0 deletions

10
main.py
View file

@ -1,5 +1,6 @@
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
from fastapi.middleware.cors import CORSMiddleware
import os
import csv
import json
@ -7,6 +8,15 @@ from pathlib import Path
app = FastAPI(title="Static2API")
# Add CORS middleware to allow cross-origin requests
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # Allows all origins
allow_credentials=True,
allow_methods=["*"], # Allows all methods
allow_headers=["*"], # Allows all headers
)
@app.get("/")
async def root():
return {"message": "Welcome to Static2API"}