Browse Source

Add Index Route to API

oscarleiva 7 năm trước cách đây
mục cha
commit
bb15347d4a
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      flask_api/web/app/server.py

+ 7 - 1
flask_api/web/app/server.py

@@ -6,6 +6,12 @@ from utils import PreProcessing
 
 app = Flask(__name__)
 
+@app.route('/')
+def index():
+	""" Index Web Page
+	"""
+	return "Modelo Mexico PML Day Ahead Forecast"
+
 @app.route('/predict', methods=['POST'])
 def apicall():
 	"""API Call
@@ -70,4 +76,4 @@ def bad_request(error=None):
 	return resp
 
 if __name__ == '__main__':
-	app.run()
+	app.run(host='0.0.0.0')