Skip to content
Snippets Groups Projects
Commit 3061d205 authored by izacarias's avatar izacarias
Browse files

Properly redirecting users to the GUI (using HTTP headers)

parent b81a5c6b
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@ import warnings
from flask import Flask, request, render_template
from fastapi.middleware.wsgi import WSGIMiddleware
from fastapi.staticfiles import StaticFiles
from fastapi.responses import RedirectResponse
import config
import get_intents_script
......@@ -40,10 +41,9 @@ print('creating APIs')
@app.get('/')
def first_page():
to_return = {
'gui_endpoint': '/gui',
}
return to_return
# If the user reaches the root document, it redirects the user to
# the GUI
return RedirectResponse("/gui")
#API for receiving intents from the DTE
class Intent(BaseModel):
......@@ -248,6 +248,7 @@ def ml_reco():
@flask_app.route('/intents.html')
def intents_html():
stored_intents_arr = get_intents_script.get_intent_fun(stored_intents_url)
items = stored_intents_arr[0].items()
keys = [key for key, value in items]
headings = tuple(keys)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment