diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml new file mode 100644 index 0000000..7b6529f --- /dev/null +++ b/.idea/dataSources.xml @@ -0,0 +1,12 @@ + + + + + mariadb + true + org.mariadb.jdbc.Driver + jdbc:mariadb://193.124.203.110:3306/wind_towers + $ProjectFileDir$ + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..6fa30af --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/webResources.xml b/.idea/webResources.xml new file mode 100644 index 0000000..913f4b6 --- /dev/null +++ b/.idea/webResources.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/src/main.py b/server/src/main.py index 692fdde..a535ffc 100644 --- a/server/src/main.py +++ b/server/src/main.py @@ -6,6 +6,7 @@ from fastapi.staticfiles import StaticFiles from routers.floris_router import router as floris_router from routers.floris_template_router import router as floris_template_router +from routers.weather_router import router as weather_router app = FastAPI() @@ -15,8 +16,4 @@ app.mount("/public", StaticFiles(directory=Path("../public")), name="public") app.include_router(floris_router) app.include_router(floris_template_router) - - -# if __name__ == "__main__": -# import uvicorn -# uvicorn.run(app, host="localhost", port=8080) # Изменено на localhost +app.include_router(weather_router) diff --git a/server/src/routers/weather_router.py b/server/src/routers/weather_router.py new file mode 100644 index 0000000..01703fe --- /dev/null +++ b/server/src/routers/weather_router.py @@ -0,0 +1,13 @@ +from fastapi import APIRouter +from data.repository import WeatherRepository + +router = APIRouter( + prefix="/api/weather", + tags=["Weather Api"], +) + + +@router.get("/") +async def get_weather(): + return WeatherRepository().get_all() +