Skip to content

Commit

Permalink
Version endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
connorslade committed Nov 30, 2023
1 parent 17fb670 commit 4a1f501
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/routes/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import forgot_password, login, logout, register, student, teacher
from . import forgot_password, login, logout, register, student, teacher, version
13 changes: 13 additions & 0 deletions src/routes/version.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4a1f501

Please sign in to comment.