forked from yaso_meth/mih-project
12 July 2024
This commit is contained in:
Binary file not shown.
@@ -2,8 +2,28 @@ from fastapi import FastAPI, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from .routers import docOffices, patients, patients_files, patients_notes, users, fileStorage, medicine
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.middleware import Middleware
|
||||
|
||||
app = FastAPI()
|
||||
origins = [
|
||||
"http://localhost",
|
||||
"http://localhost:80",
|
||||
"http://localhost:8080",
|
||||
"http://MIH-API-Hub:80",
|
||||
"http://MIH-API-Hub",
|
||||
"*",
|
||||
]
|
||||
|
||||
middleware = [
|
||||
Middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=origins,
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
]
|
||||
|
||||
app = FastAPI(middleware=middleware)
|
||||
app.include_router(docOffices.router)
|
||||
app.include_router(patients.router)
|
||||
app.include_router(patients_files.router)
|
||||
@@ -12,20 +32,6 @@ app.include_router(users.router)
|
||||
app.include_router(fileStorage.router)
|
||||
app.include_router(medicine.router)
|
||||
|
||||
origins = [
|
||||
"http://localhost",
|
||||
"http://localhost:80",
|
||||
"api",
|
||||
"*"
|
||||
]
|
||||
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=origins,
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# Check if server is up
|
||||
@app.get("/")
|
||||
|
||||
Reference in New Issue
Block a user