mirror of
https://github.com/iritmaximus/timetrials.git
synced 2026-10-12 19:13:48 +03:00
feat: changed the project structure and added new routes
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<title>Main page</title>
|
||||
<h1>Home</h1>
|
||||
|
||||
<p><a href="/games">Go to games</a></p>
|
||||
<p><a href="/courses">Go to courses</a></p>
|
||||
<p><a href="/times">Go to times</a></p>
|
||||
@@ -0,0 +1,9 @@
|
||||
<title>Login</title>
|
||||
<h1>Login page</h1>
|
||||
|
||||
<form action="/login" method="POST">
|
||||
<input type="text" name="name">
|
||||
<input type="submit" name="login">
|
||||
</form>
|
||||
|
||||
<p><a href="/">Return to homepage</a></p>
|
||||
@@ -0,0 +1,2 @@
|
||||
def generate_token_with_username():
|
||||
pass
|
||||
+29
-6
@@ -1,22 +1,45 @@
|
||||
from flask import render_template, request
|
||||
|
||||
from flaskr import app
|
||||
from flaskr.database import db, test_db, create_db
|
||||
|
||||
|
||||
@app.route("/")
|
||||
def test_backend():
|
||||
return "This is the working backend"
|
||||
return render_template("home.html")
|
||||
|
||||
|
||||
@app.route("/db")
|
||||
def test_db_route():
|
||||
return test_db()
|
||||
# TODO show 3 games with most times submitted
|
||||
@app.route("/games")
|
||||
def get_games():
|
||||
return "List of games"
|
||||
|
||||
|
||||
@app.route("/login")
|
||||
# TODO show 3 courses with most activity
|
||||
@app.route("/courses")
|
||||
def get_courses():
|
||||
return "List of courses"
|
||||
|
||||
|
||||
# TODO show 3 newest times submitted
|
||||
@app.route("/times")
|
||||
def get_times():
|
||||
return "List of times"
|
||||
|
||||
|
||||
@app.route("/login", methods=["GET", "POST"])
|
||||
def login():
|
||||
return "Login to the site"
|
||||
if request.method == "GET":
|
||||
return render_template("login.html")
|
||||
else:
|
||||
return "Todo POST request"
|
||||
|
||||
|
||||
@app.route("/init")
|
||||
def initialize_db():
|
||||
return create_db()
|
||||
|
||||
|
||||
@app.route("/db")
|
||||
def test_db_route():
|
||||
return test_db()
|
||||
|
||||
Reference in New Issue
Block a user