From 90abf7d7a0b252c2af3c4c24d1d7ae2e11d9774b Mon Sep 17 00:00:00 2001 From: Luke Berndt Date: Tue, 5 Mar 2024 22:10:57 -0500 Subject: [PATCH] Update occlusion_mapper.py --- occlusion-mapper/occlusion_mapper.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/occlusion-mapper/occlusion_mapper.py b/occlusion-mapper/occlusion_mapper.py index e587cac..15efae1 100644 --- a/occlusion-mapper/occlusion_mapper.py +++ b/occlusion-mapper/occlusion_mapper.py @@ -5,7 +5,7 @@ from time import sleep from typing import Any, Tuple from datetime import datetime -from flask import Flask, request, jsonify +from flask import Flask, request, jsonify, send_from_directory, render_template from flask_cors import CORS, cross_origin from threading import Thread @@ -43,10 +43,13 @@ def __init__( def hello_world(): return f'var camera_ip = "{self.camera_ip}";' + @self.app.route("/") + def hello(): + return render_template("index.html") # Set the default entrance point to 'index.html' - @self.app.route('/') - def index(): - return send_from_directory('static', 'index.html') + # @self.app.route('/') + # def index(): + # return send_from_directory('static', 'index.html') # self.app.run(host="0.0.0.0", debug=True, port=5000) # Connect client in constructor @@ -125,7 +128,8 @@ def main(self: Any) -> None: frontend_thread = Thread( target=self.app.run, - kwargs={"host": "0.0.0.0", "port": 5000, "debug": False}, + kwargs={"host": "0.0.0.0", "port": 5000, "debug": False, "static_url_path":"", "static_folder":"static", + "template_folder": "static"}, ) frontend_thread.start()