-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (24 loc) · 704 Bytes
/
main.py
File metadata and controls
32 lines (24 loc) · 704 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
30
31
32
import fastapi
import uvicorn
from starlette.staticfiles import StaticFiles
from api import weather
from api import report
from views import home
import sentry_sdk
sentry_sdk.init(
dsn='https://1ac0e678f7eb4f9ba14ee889615eee7c@sentry.hamravesh.com/536',
traces_sample_rate=1.0,
)
app = fastapi.FastAPI()
def configure():
configure_routing()
def configure_routing():
app.mount('/static', StaticFiles(directory='static'), name='static')
app.include_router(home.router)
app.include_router(weather.router)
app.include_router(report.router)
if __name__ == '__main__':
configure()
uvicorn.run('main:app', port=80, host='127.0.0.1', reload=True)
else:
configure()