diff --git a/api/app.py b/api/app.py index bcbc87e..4de28d1 100644 --- a/api/app.py +++ b/api/app.py @@ -18,5 +18,35 @@ async def run_nyserda_large(): return {"message": "Hello NYSERDA Large"} +@app.route("/api/nyserda_solar", methods=["GET"]) +async def run_nyserda_solar(): + nyserda_solar_to_database() + return {"message": "Helo NYSERDA Solar"} + + +@app.route("/api/nyiso", methods=["GET"]) +async def run_nyiso(): + nyiso_to_database() + return {"message": "Hello NYISO"} + + +@app.route("/api/ores_noi", methods=["GET"]) +async def run_ores_noi(): + ores_noi_to_database() + return {"message": "Hello ORES NOI"} + + +@app.route("/api/ores_under_review", methods=["GET"]) +async def run_ores_under_review(): + ores_under_review_to_database() + return {"message": "Hello ORES Under Review"} + + +@app.route("/api/ores_permitted", methods=["GET"]) +async def run_ores_permitted(): + ores_permitted_to_database() + return {"message": "Hello ORES Permitted"} + + if __name__ == "__main__": app.run(port=5328, debug=True) diff --git a/api/webscraper/database.py b/api/webscraper/database.py index 209b557..24dad73 100644 --- a/api/webscraper/database.py +++ b/api/webscraper/database.py @@ -755,7 +755,7 @@ def ores_permitted_to_database() -> None: """ For testing """ -nyserda_large_to_database() +# nyserda_large_to_database() # nyserda_solar_to_database() # nyiso_to_database() # ores_noi_to_database() diff --git a/api/webscraper/server.py b/api/webscraper/server.py deleted file mode 100644 index 40ebe71..0000000 --- a/api/webscraper/server.py +++ /dev/null @@ -1,50 +0,0 @@ -from fastapi import FastAPI, Response -from database import * - -app = FastAPI() - - -@app.get("/favicon.ico") -def favicon(): - return Response(content=open("favicon.ico", "rb").read(), media_type="image/x-icon") - - -@app.get("/") -async def root(): - return {"message": "Hello World"} - - -@app.get("/nyserda_large") -async def run_nyserda_large(): - nyserda_large_to_database() - return {"message": "Hello NYSERDA Large"} - - -@app.get("/nyserda_solar") -async def run_nyserda_solar(): - nyserda_solar_to_database() - return {"message": "Hello NYSERDA Solar"} - - -@app.get("/nyiso") -async def run_nyiso(): - nyiso_to_database() - return {"message": "Hello NYISO"} - - -@app.get("/ores_noi") -async def run_ores_noi(): - ores_noi_to_database() - return {"message": "Hello ORES NOI"} - - -@app.get("/ores_under_review") -async def run_ores_under_review(): - ores_under_review_to_database() - return {"message": "Hello ORES Under Review"} - - -@app.get("/ores_permitted") -async def run_ores_permitted(): - ores_permitted_to_database() - return {"message": "Hello ORES Permitted"}