Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
pirms 1 gada
123456789101112131415161718192021222324252627282930
  1. from fastapi import FastAPI
  2. from core.config import settings
  3. from db.session import engine
  4. from db.base import Base
  5. from apis.base import api_router
  6. def include_routes(app): # include all routes from our api/v1/
  7. app.include_router(api_router)
  8. def startup(): # start the project, and create the tables
  9. app = FastAPI(title=settings.PROJECT_NAME, version=settings.PROJECT_VERSION)
  10. Base.metadata.create_all(bind=engine)
  11. include_routes(app)
  12. return app
  13. app = startup()
  14. # Testing stuff
  15. @app.get("/")
  16. def root():
  17. return {"message": "Hello World!"}
  18. @app.get("/user")
  19. def get_users():
  20. return {{"name": "almaz"}, {"name": "madi"}}