diff --git a/src/main.py b/src/main.py index c2c069c..4385d8b 100644 --- a/src/main.py +++ b/src/main.py @@ -2,6 +2,8 @@ from app import app, db import routes +VERSION = "0.1.0" + if __name__ == "__main__": with app.app_context(): db.create_all() diff --git a/src/routes/__init__.py b/src/routes/__init__.py index 851d4ae..9389f05 100644 --- a/src/routes/__init__.py +++ b/src/routes/__init__.py @@ -1 +1 @@ -from . import forgot_password, login, logout, register, student, teacher +from . import forgot_password, login, logout, register, student, teacher, version diff --git a/src/routes/version.py b/src/routes/version.py new file mode 100644 index 0000000..b4f112d --- /dev/null +++ b/src/routes/version.py @@ -0,0 +1,13 @@ +from flask import Response + +from app import app +from main import VERSION + +AUTHORS = "Originally By Matthias Masiero and Jaiman Munshi\nUpdated by Connor Slade" + + +@app.get("/version") +def version(): + res = Response(f"CompSci-RP-Website v{VERSION}\n{AUTHORS}") + res.mimetype = "text/plain" + return res