Notice
Recent Posts
Recent Comments
Link
«   2025/06   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags more
Archives
Today
Total
관리 메뉴

기록

FastApi 이클립스 연결 후 출력해보기 본문

PYTHON

FastApi 이클립스 연결 후 출력해보기

9400 2023. 1. 5. 14:47

FastAPI 설치

 

cmd창에서 설치 

pip3 install fastapi
# FastAPI 사용을 위한 설치
pip3 install uvicorn
# 파이썬 서버실행기인 uvicorn 설치

 

환경변수 설정

 

 

확인

 

설치후 

 

from fastapi import FastAPI
import uvicorn

app = FastAPI()

@app.get("/")
async def root():
    return "Hello World"

if __name__ == "__main__":
    uvicorn.run(app, host="localhost", port=8000)

아파치 톰캣 서버 종료 후 

 

 

 

 

출력 성공 ㅋ

 

 

post.html 생성 후 

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="http://localhost:8000/post" method="post">
<input type="submit" value="포스트로보냄" />

</form>

</body>
</html>

 

'PYTHON' 카테고리의 다른 글

python과 mssql DB연동하여 CRUD하기 2  (0) 2023.01.09
mssql python연동하여 CRUD하기  (0) 2023.01.04
PYQT 베이스볼 게임 만들기  (0) 2023.01.03
PYQT 두수의 곱 구하기  (0) 2023.01.02
PYQT 배수의합구하기  (0) 2023.01.02
Comments