-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
49 lines (39 loc) · 1.02 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers import airdrops, machines, products, transactions, users
app = FastAPI(
title='ToyMoneyServer',
description='Build and use toy money easily.',
version='0.1'
)
@app.get('/')
async def hello():
return {"status": 200, "message": "API is running."}
app.include_router(
airdrops.router,
prefix="/airdrops",
responses={404: {"description": "Not found"}},
)
app.include_router(
machines.router,
prefix="/machines",
responses={404: {"description": "Not found"}},
)
app.include_router(
products.router,
prefix="/products",
responses={404: {"description": "Not found"}},
)
app.include_router(
transactions.router,
prefix="/transactions",
responses={404: {"description": "Not found"}},
)
app.include_router(
users.router,
prefix="/users",
responses={404: {"description": "Not found"}},
)
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=5000)