기록
FastApi 이클립스 연결 후 출력해보기 본문
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