Loading server.py +10 −1 Original line number Diff line number Diff line # os import import os # ml import import ml Loading @@ -5,13 +8,19 @@ import ml from flask import Flask, send_from_directory app = Flask(__name__) # Endpoint to load index.html @app.route('/') @app.route('/index') def display_greeting(): #return contents of /web/index.html return send_from_directory('web', 'index.html') # Endpoint to load js files @app.route('/js/main.js') def get_script(): doctype = 'application/js' return send_from_directory('web/js', 'main.js', mimetype=doctype) # Run the app! if __name__ == '__main__': Loading web/js/main.js +1 −0 Original line number Diff line number Diff line function getPrediction() { var url = "http://localhost:8080" var endpoint = "/predict" Loading Loading
server.py +10 −1 Original line number Diff line number Diff line # os import import os # ml import import ml Loading @@ -5,13 +8,19 @@ import ml from flask import Flask, send_from_directory app = Flask(__name__) # Endpoint to load index.html @app.route('/') @app.route('/index') def display_greeting(): #return contents of /web/index.html return send_from_directory('web', 'index.html') # Endpoint to load js files @app.route('/js/main.js') def get_script(): doctype = 'application/js' return send_from_directory('web/js', 'main.js', mimetype=doctype) # Run the app! if __name__ == '__main__': Loading
web/js/main.js +1 −0 Original line number Diff line number Diff line function getPrediction() { var url = "http://localhost:8080" var endpoint = "/predict" Loading