-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
47 lines (39 loc) · 1.18 KB
/
Copy pathmain.py
File metadata and controls
47 lines (39 loc) · 1.18 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from fastapi import FastAPI
import uvicorn
from api.routers import api_router
# from api.endpoints.v1 import auths, users, prompts
tags_metadata = [
{
"name": "Auth",
"description": "Authentication operations (login, signup, password recovery).",
},
{
"name": "Users",
"description": "Operations with users (CRUD).",
},
{
"name": "Prompts",
"description": "Operations with prompts.",
},
]
myapp = FastAPI(
title="Portfolio API",
description="API for managing users, prompts, and authentication in a web environment.",
version="0.1.0",
docs_url="/docs",
redoc_url="/redoc",
openapi_tags=tags_metadata
)
@myapp.get("/")
def root():
return {"Portfolio App": "This is a simple app using FastAPI and mariadb."}
# Include all API routes
myapp.include_router(api_router, prefix="/api/v1", tags=["api"])
# Include routers
"""
app.include_router(users.router, prefix="/users", tags=["Users"])
app.include_router(prompts.router, prefix="/prompts", tags=["Prompts"])
app.include_router(auths.router, prefix="/auth", tags=["Auth"])
"""
if __name__ == "__main__":
uvicorn.run(myapp, host="127.0.0.1", port=8000)