Added placeholder webite for main website

This commit is contained in:
2024-11-12 14:30:45 +01:00
parent 0e30854b51
commit 661fdb9d26
4 changed files with 193 additions and 48 deletions

View File

@@ -15,11 +15,15 @@ mqtt_client.loop_start()
mqtt_client.subscribe("kobuki/data")
mqtt_client.on_message = on_message # this lines needs to be under the function definition otherwise it cant find which function it needs to use
@app.route('/', methods=["GET","POST"])
@app.route('/')
def index():
return render_template('index.html')
@app.route('/control', methods=["GET","POST"])
def control():
if request.authorization and request.authorization.username == 'ishak' and request.authorization.password == 'kobuki':
return render_template('index.html')
return render_template('control.html')
else:
return ('Unauthorized', 401, {'WWW-Authenticate': 'Basic realm="Login Required"'})