Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import asyncio
|
2 |
from fastapi import FastAPI
|
|
|
3 |
import requests
|
4 |
import pandas as pd
|
5 |
import json
|
@@ -7,6 +8,14 @@ import json
|
|
7 |
global data
|
8 |
app = FastAPI()
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
# Declare the continuous function as an async function.
|
11 |
async def your_continuous_function():
|
12 |
import pandas as pd
|
|
|
1 |
import asyncio
|
2 |
from fastapi import FastAPI
|
3 |
+
from fastapi.middleware.cors import CORSMiddleware
|
4 |
import requests
|
5 |
import pandas as pd
|
6 |
import json
|
|
|
8 |
global data
|
9 |
app = FastAPI()
|
10 |
|
11 |
+
app.add_middleware(
|
12 |
+
CORSMiddleware,
|
13 |
+
allow_origins=["*"],
|
14 |
+
allow_credentials=True,
|
15 |
+
allow_methods=["*"],
|
16 |
+
allow_headers=["*"],
|
17 |
+
)
|
18 |
+
|
19 |
# Declare the continuous function as an async function.
|
20 |
async def your_continuous_function():
|
21 |
import pandas as pd
|