Skip to content
Snippets Groups Projects
Commit d6fda656 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Add survey entrypoint and build survey app

parent fe0cdcb4
No related branches found
No related tags found
1 merge request!42Feature/comp 204 survey webapp
...@@ -43,6 +43,19 @@ def index(path): ...@@ -43,6 +43,19 @@ def index(path):
# https://flask.palletsprojects.com/en/2.0.x/patterns/singlepageapplications/ # https://flask.palletsprojects.com/en/2.0.x/patterns/singlepageapplications/
return render_template('index.html') return render_template('index.html')
@routes.route('/survey', defaults={'path': ''}, methods=['GET'])
@routes.route('/survey/<path:path>', methods=['GET'])
def survey_index(path):
is_api = path.startswith('api')
if is_api:
# return 404 for API requests that don't match a route
return Response(status=404, mimetype='application/json', response='{"error": "Not Found"}')
# fallback to serving the SPA through index.html for all other requests
# https://flask.palletsprojects.com/en/2.0.x/patterns/singlepageapplications/
return render_template('survey-index.html')
@routes.route('/version', methods=['GET', 'POST']) @routes.route('/version', methods=['GET', 'POST'])
@common.require_accepts_json @common.require_accepts_json
... ...
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment