forked from yezz123/DogeAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (22 loc) · 902 Bytes
/
main.py
File metadata and controls
29 lines (22 loc) · 902 Bytes
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
#!/usr/bin/python3
from fastapi import FastAPI, Request
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from starlette.responses import HTMLResponse
from core import auth, blog, user
from database.configuration import engine
from models import models
models.Base.metadata.create_all(bind=engine)
app = FastAPI(
title="DogeAPI",
description="API with high performance built with FastAPI & SQLAlchemy, help to improve connection with your Backend Side.",
version="1.0.0",
)
app.mount("/static", StaticFiles(directory="static"), name="static")
templates = Jinja2Templates(directory="templates")
app.include_router(auth.router)
app.include_router(blog.router)
app.include_router(user.router)
@app.get("/", response_class=HTMLResponse)
async def index(request: Request):
return templates.TemplateResponse("index.html", {"request": request})