-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
48 lines (34 loc) · 910 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from config.database import engine, Base
from middleware.error_handler import ErrorHandler
from routers.movie import movie_router
from routers.login import login_router
app = FastAPI()
app.title = 'Mi primer app con FasAPI'
app.version = '0.0.1'
app.include_router(movie_router)
app.include_router(login_router)
app.add_middleware(ErrorHandler)
Base.metadata.create_all(bind=engine)
movies = [
{
"id": 1,
"title": "Avatar",
"overview": "Domina todos los elementos",
"year": "2009",
"rating": 7.8,
"category": "Accion"
},
{
"id": 2,
"title": "Avatar 2",
"overview": "Domina todos los elementos",
"year": "2009",
"rating": 7.8,
"category": "Accion"
}
]
@app.get('/', tags=['German'])
def message():
return HTMLResponse('<h1>Hello world!</h1>')