Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
brian-dashboard-manager
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
brian
brian-dashboard-manager
Commits
a3aaaf2e
Commit
a3aaaf2e
authored
3 years ago
by
Bjarke Madsen
Browse files
Options
Downloads
Patches
Plain Diff
Add version endpoint
parent
f94110a5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
brian_dashboard_manager/__init__.py
+2
-1
2 additions, 1 deletion
brian_dashboard_manager/__init__.py
brian_dashboard_manager/routes/version.py
+23
-0
23 additions, 0 deletions
brian_dashboard_manager/routes/version.py
with
25 additions
and
1 deletion
brian_dashboard_manager/__init__.py
+
2
−
1
View file @
a3aaaf2e
...
...
@@ -34,8 +34,9 @@ def create_app():
app
.
secret_key
=
os
.
environ
.
get
(
'
SECRET_KEY
'
,
'
super secret session key
'
)
app
.
config
[
CONFIG_KEY
]
=
app_config
from
brian_dashboard_manager.routes
import
update
from
brian_dashboard_manager.routes
import
update
,
version
app
.
register_blueprint
(
update
.
routes
,
url_prefix
=
'
/update
'
)
app
.
register_blueprint
(
version
.
routes
,
url_prefix
=
'
/version
'
)
logging
.
info
(
'
Flask app initialized
'
)
environment
.
setup_logging
()
...
...
This diff is collapsed.
Click to expand it.
brian_dashboard_manager/routes/version.py
0 → 100644
+
23
−
0
View file @
a3aaaf2e
import
pkg_resources
from
flask
import
Blueprint
,
jsonify
from
brian_dashboard_manager.routes
import
common
routes
=
Blueprint
(
"
version
"
,
__name__
)
API_VERSION
=
'
0.1
'
@routes.after_request
def
after_request
(
resp
):
return
common
.
after_request
(
resp
)
@routes.route
(
"
/
"
,
methods
=
[
'
GET
'
,
'
POST
'
])
@common.require_accepts_json
def
version
():
version_params
=
{
'
api
'
:
API_VERSION
,
'
module
'
:
pkg_resources
.
get_distribution
(
'
brian-dashboard-manager
'
).
version
}
return
jsonify
(
version_params
)
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