Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change client 주소 #3

Merged
merged 2 commits into from
Aug 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
__pycache__/
.DS_Store
10 changes: 5 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
app=FastAPI()

# react client 주소
origins = ['http://localhost:3000']
origins = "https://seo-inyoung.github.io/dce-client/"

# 모든 origin, 모든 cookie, 모든 method, 모든 header를 allow 한다는 얘기
app.add_middleware(
Expand All @@ -25,15 +25,15 @@
# html 파일이 있는 폴더 설정
templates = Jinja2Templates(directory="templates")

## 루트 경로
# 루트 경로
#@app.get("/",response_class=HTMLResponse)
#async def read_root(request:Request):
# return templates.TemplateResponse("index.html",{"request":request,"error":False})

# react app과 연결되었는지 확인하는 Default code.return 값 수정 필요
# 루트 경로
@app.get("/")
async def root():
return{"kwang jeong"}
async def root(request:Request):
return {"kwang jeong"}

#메일 서버 접속 실패시
@app.post("/",response_class=HTMLResponse)
Expand Down