-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added server.py in project folder to host site instead of using node - Fixed bug in paragoncalc.js which stopped power being calculated - Added Flask to requirements.txt - Updated README to now include Python commands
- Loading branch information
1 parent
d1552cf
commit 828211d
Showing
4 changed files
with
50 additions
and
6 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
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
python-dotenv | ||
python-dotenv | ||
flask |
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,28 @@ | ||
""" | ||
Basic Flask server to serve webpage. | ||
""" | ||
|
||
from flask import Flask | ||
|
||
HOSTADDR = "localhost" | ||
PORT = 3124 | ||
|
||
app = Flask(__name__, static_folder="webpage", static_url_path="") | ||
app.config.from_object(__name__) | ||
|
||
|
||
@app.route("/", methods=["GET"]) | ||
def main_page(): | ||
""" | ||
Returns the main page of the application. | ||
This function sends the static file "index.html" as the main page of the application. | ||
Returns: | ||
str: The content of the "index.html" file. | ||
""" | ||
return app.send_static_file("index.html") | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(host=HOSTADDR, port=PORT, debug=True) |
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