Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
compendium-v2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
compendium-v2
Commits
6ade0d08
Commit
6ade0d08
authored
2 years ago
by
Bjarke Madsen
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into feature/COMP-152-EC-PROJECTS-TABLE
parents
d29aa29a
f2ae0a7b
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!11
merge feature/COMP-152-EC-PROJECTS-TABLE into develop
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compendium_v2/routes/default.py
+8
-1
8 additions, 1 deletion
compendium_v2/routes/default.py
with
8 additions
and
1 deletion
compendium_v2/routes/default.py
+
8
−
1
View file @
6ade0d08
...
...
@@ -11,7 +11,7 @@ Default Endpoints
"""
import
pkg_resources
from
flask
import
Blueprint
,
jsonify
,
render_template
from
flask
import
Blueprint
,
jsonify
,
render_template
,
Response
from
compendium_v2.routes
import
common
...
...
@@ -45,6 +45,13 @@ def after_request(resp):
@routes.route
(
'
/
'
,
defaults
=
{
'
path
'
:
''
},
methods
=
[
'
GET
'
])
@routes.route
(
'
/<path:path>
'
,
methods
=
[
'
GET
'
])
def
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
(
'
index.html
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment