Allow CORS

This commit is contained in:
oitsjustjose 2025-06-17 12:38:58 -05:00
commit 7a881f0f6a

View file

@ -8,14 +8,21 @@ Changes come in via WebAPI so we can make a lightweight desktop client and leave
Also allows the TidByt to still have forgeserv.net data without needing to be stood up Also allows the TidByt to still have forgeserv.net data without needing to be stood up
""" """
import logging
import docker import docker
from fastapi import FastAPI, Response, status from fastapi import FastAPI, Response, status
from fastapi.middleware.cors import CORSMiddleware
from common import list_servers from common import list_servers
app: FastAPI = FastAPI() app: FastAPI = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins="*",
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
client = docker.from_env() client = docker.from_env()