-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (27 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
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers.interpolation import p_interpolation_router
from routers.regression import p_regression_router
from routers.definite_integration import p_definite_integration_router
from routers.methodology import p_methodology_router
from routers.differential_equation import p_differential_equation_router
# INFO: Processing
app = FastAPI()
app.title = 'Processing'
origins = [
"https://api-numerical.onrender.com",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["GET", "POST"],
allow_headers=["Content-Type", "Authorization"],
expose_headers=["Content-Type", "Authorization"],
max_age=3600, # tiempo de vida de la configuración CORS (en segundos)
)
app.include_router(p_interpolation_router)
app.include_router(p_regression_router)
app.include_router(p_definite_integration_router)
app.include_router(p_methodology_router)
app.include_router(p_differential_equation_router)