feat: added vue router

This commit is contained in:
2020-10-29 22:46:30 +01:00
parent 2aebb5c869
commit 6ce268fc49
7 changed files with 134 additions and 47 deletions

15
app.py
View File

@@ -52,20 +52,13 @@ class CameraListener:
sio.sleep(0.05)
@app.route('/')
def index():
@app.route('/', defaults={'path': ''})
@app.route('/<string:path>')
@app.route('/<path:path>') # does not seem to work
def index(path):
return send_file('client/dist/index.html')
@app.route('/imagestream.mjpg')
def image_stream():
# ps = redisdb.pubsub()
# cam = Camera()
# return Response(cam.mjpeg_stream(boundary.encode()),
# mimetype='multipart/x-mixed-replace; boundary=lkajflkasdjlkfaj')
return ""
@sio.on("camera")
def camera_message(directions):
# walle.set_eye_velocity(directions['angle'], directions['force'])