dotku commited on
Commit
0e3d371
1 Parent(s): bfc8f4e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -0
main.py CHANGED
@@ -2,6 +2,18 @@ from fastapi import FastAPI
2
 
3
  app = FastAPI()
4
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  @app.get("/api/python")
6
  def hello_world():
7
  return {"message": "Hello World"}
 
2
 
3
  app = FastAPI()
4
 
5
+ origins = ['http://localhost:3000', 'http://127.0.0.1:3000',
6
+ 'https://localhost:3000', 'https://127.0.0.1:3000']
7
+
8
+ app.add_middleware(
9
+ CORSMiddleware,
10
+ allow_origins=['*']
11
+ )
12
+
13
+ @app.get("/")
14
+ def read_root():
15
+ return {"message": "Hello World"}
16
+
17
  @app.get("/api/python")
18
  def hello_world():
19
  return {"message": "Hello World"}