Skip to content

Commit

Permalink
add cors middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
tbdsux committed Nov 16, 2022
1 parent de6c469 commit 2972f96
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Dict, Any

from fastapi import FastAPI, Response
from fastapi.middleware.cors import CORSMiddleware

# bypassing cloudflare anti-bot
import cloudscraper
Expand All @@ -11,6 +12,15 @@
app = FastAPI()


app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)


@app.get("/")
async def index() -> str:
return "A Simple and Basic MDL Scraper API"
Expand Down

1 comment on commit 2972f96

@vercel
Copy link

@vercel vercel bot commented on 2972f96 Nov 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kuryana – ./

kuryana.vercel.app
kuryana-git-master-theboringdude.vercel.app
kuryana-theboringdude.vercel.app

Please sign in to comment.