mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-12 16:22:17 -05:00
Status page updated with api version and db version.
This commit is contained in:
@@ -4,7 +4,7 @@ from __future__ import print_function
|
||||
import os
|
||||
from flask.ext.script import Manager, Server
|
||||
from flask.ext.migrate import Migrate, MigrateCommand
|
||||
from app import create_app, db
|
||||
from app import (create_app, db, get_api_version, get_db_version)
|
||||
|
||||
application = create_app(os.getenv('NOTIFY_API_ENVIRONMENT') or 'development')
|
||||
manager = Manager(application)
|
||||
@@ -22,5 +22,21 @@ def list_routes():
|
||||
print("{:10} {}".format(", ".join(rule.methods - set(['OPTIONS', 'HEAD'])), rule.rule))
|
||||
|
||||
|
||||
@manager.command
|
||||
def api_version():
|
||||
"""
|
||||
Retrieve the version of the api.
|
||||
"""
|
||||
return get_api_version()
|
||||
|
||||
|
||||
@manager.command
|
||||
def db_version():
|
||||
"""
|
||||
Retrieve the db version.
|
||||
"""
|
||||
return get_db_version()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
manager.run()
|
||||
|
||||
Reference in New Issue
Block a user