mirror of
https://github.com/jaypyles/Scraperr.git
synced 2025-12-12 02:35:43 +00:00
wip: almost done with working webapp template
This commit is contained in:
23
api/backend/app.py
Normal file
23
api/backend/app.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# STL
|
||||
import logging
|
||||
|
||||
# PDM
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
app = FastAPI(title="api")
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
|
||||
@app.route("/api/endpoint")
|
||||
async def test_route():
|
||||
return {"hello": "world"}
|
||||
Reference in New Issue
Block a user