-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
29 lines (24 loc) · 859 Bytes
/
main.py
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
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers import Users
from routers import Posts
from routers import Public
from db.db import users
app = FastAPI(
title="Blog creator",
description="This is a blog creation app where user can register and make a blog and others can visit that blog also uses allows user to upload images ",
contact={
"name": "Ahmed Ali",
"email": "ahmedalibalti2000@gmail.com"
})
origins = ["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(Public.router, prefix="/Visitor",tags=["Visitor"])
app.include_router(Posts.router, prefix="/User/Posts",tags=["Blog Owner"])
app.include_router(Users.router, prefix="/User",tags=["Users"])