Files
notifications-admin/app.py

21 lines
559 B
Python
Raw Normal View History

2015-11-23 13:50:37 +00:00
import os
from flask.ext.script import Manager, Server
2016-03-03 16:41:21 +00:00
from app import create_app
2015-11-23 13:50:37 +00:00
application = create_app()
manager = Manager(application)
port = int(os.environ.get('PORT', 6012))
manager.add_command("runserver", Server(host='0.0.0.0', port=port))
2016-01-27 16:32:40 +00:00
2015-11-23 13:50:37 +00:00
@manager.command
def list_routes():
"""List URLs of all application routes."""
for rule in sorted(application.url_map.iter_rules(), key=lambda r: r.rule):
print("{:10} {}".format(", ".join(rule.methods - set(['OPTIONS', 'HEAD'])), rule.rule))
2015-11-23 13:50:37 +00:00
2015-11-23 14:55:37 +00:00
if __name__ == '__main__':
manager.run()