Status page updated with api version and db version.

This commit is contained in:
Nicholas Staples
2016-01-29 12:51:33 +00:00
parent 2bd244032b
commit 99b849171f
5 changed files with 98 additions and 4 deletions

View File

@@ -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()