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.

26 lines
513 B

  1. from fastapi import FastAPI
  2. from core.config import settings
  3. from db.session import engine
  4. from db.base_model import Base
  5. def startup(): #start the project, and create the tables
  6. app = FastAPI(title=settings.PROJECT_NAME,version=settings.PROJECT_VERSION)
  7. Base.metadata.create_all(bind=engine)
  8. return app
  9. app = startup()
  10. @app.get("/")
  11. def root():
  12. return {"message": "Hello World!"}
  13. @app.get("/user")
  14. def get_users():
  15. return {
  16. {"name": "almaz"},
  17. {"name": "madi"}
  18. }