-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.py
More file actions
26 lines (21 loc) · 940 Bytes
/
Copy pathindex.py
File metadata and controls
26 lines (21 loc) · 940 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
from fastapi import FastAPI, status
from fastapi.middleware.cors import CORSMiddleware
from api.auth import auth_router
from api.manage import manage_router
from api.mock import mock_router
app = FastAPI(title='ImpostAPI',
description=' A high-performance, asynchronous Mock API generator built with FastAPI and MongoDB. It allows developers to design and deploy custom JSON endpoints in seconds, featuring dynamic routing, configurable HTTP status codes, and simulated network latency to streamline frontend development and testing. ',
)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=['*'],
allow_headers=['*']
)
app.include_router(auth_router)
app.include_router(manage_router)
app.include_router(mock_router)
@app.get('/', response_model=dict, status_code=status.HTTP_200_OK)
async def health():
return {'message': 'server running'}