Allow CORS
This commit is contained in:
parent
beea4ef609
commit
7a881f0f6a
1 changed files with 9 additions and 2 deletions
11
src/main.py
11
src/main.py
|
|
@ -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()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue