Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmendsenProject
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shaik Janipasha
AmendsenProject
Commits
6a0fbd8d
Unverified
Commit
6a0fbd8d
authored
Dec 01, 2020
by
Dorian Johnson
Committed by
GitHub
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: print human-readable error if index.html isn't found (#788)
Signed-off-by:
Dorian Johnson
<
2020@dorianj.net
>
parent
a8c9e7ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
__init__.py
amundsen_application/api/__init__.py
+9
-1
No files found.
amundsen_application/api/__init__.py
View file @
6a0fbd8d
...
@@ -2,11 +2,15 @@
...
@@ -2,11 +2,15 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: Apache-2.0
from
typing
import
Any
,
Tuple
from
typing
import
Any
,
Tuple
import
logging
from
flask
import
Flask
,
render_template
from
flask
import
Flask
,
render_template
import
jinja2
import
os
import
os
ENVIRONMENT
=
os
.
getenv
(
'APPLICATION_ENV'
,
'development'
)
ENVIRONMENT
=
os
.
getenv
(
'APPLICATION_ENV'
,
'development'
)
LOGGER
=
logging
.
getLogger
(
__name__
)
def
init_routes
(
app
:
Flask
)
->
None
:
def
init_routes
(
app
:
Flask
)
->
None
:
...
@@ -16,7 +20,11 @@ def init_routes(app: Flask) -> None:
...
@@ -16,7 +20,11 @@ def init_routes(app: Flask) -> None:
def
index
(
path
:
str
)
->
Any
:
def
index
(
path
:
str
)
->
Any
:
return
render_template
(
"index.html"
,
env
=
ENVIRONMENT
)
# pragma: no cover
try
:
return
render_template
(
"index.html"
,
env
=
ENVIRONMENT
)
# pragma: no cover
except
jinja2
.
exceptions
.
TemplateNotFound
as
e
:
LOGGER
.
error
(
"index.html template not found, have you built the front-end JS (npm run build in static/?"
)
raise
e
def
healthcheck
()
->
Tuple
[
str
,
int
]:
def
healthcheck
()
->
Tuple
[
str
,
int
]:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment