You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
407 B

5 years ago
  1. # pip install fastapi
  2. # pip install email-validator
  3. # pip install pydantic
  4. # pip install starlette
  5. # pip install uvicorn
  6. import uvicorn
  7. from fastapi import FastAPI
  8. app = FastAPI()
  9. @app.get("/")
  10. def read_root():
  11. return {"Hello": "World"}
  12. def run_server():
  13. uvicorn.run(app)
  14. if __name__ == '__main__':
  15. uvicorn.run(app, #'server:app',
  16. host='127.0.0.1', port=8000, reload=True)