-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] set up Flask backend and api reroutes in next.config.mjs
- Loading branch information
Showing
11 changed files
with
96 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from flask import Flask | ||
from webscraper.database import * | ||
from webscraper.nyserda_scraper import * | ||
|
||
app = Flask(__name__) | ||
|
||
# flask run --port 5328 --debug | ||
|
||
|
||
@app.route("/api/hello", methods=["GET"]) | ||
def hello_world(): | ||
return "Hello, World!" | ||
|
||
|
||
@app.route("/api/nyserda_large", methods=["GET"]) | ||
async def run_nyserda_large(): | ||
nyserda_large_to_database() | ||
return {"message": "Hello NYSERDA Large"} | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(port=5328, debug=True) |
Empty file.
Binary file modified
BIN
+0 Bytes
(100%)
api/webscraper/__pycache__/database_constants.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters