mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-09 23:02:13 -05:00
Basic commit to add get pages showing
- bootstrap script - run script - couple of views - basic config
This commit is contained in:
@@ -1,11 +1,24 @@
|
||||
from flask import Flask
|
||||
#!/usr/bin/env python
|
||||
|
||||
app = Flask(__name__)
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
|
||||
from flask.ext.script import Manager, Server
|
||||
|
||||
from app import create_app
|
||||
|
||||
application = create_app(os.getenv('NOTIFY_API_ENVIRONMENT') or 'development')
|
||||
manager = Manager(application)
|
||||
port = int(os.environ.get('PORT', 6011))
|
||||
manager.add_command("runserver", Server(host='0.0.0.0', port=port))
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return 'Hello from notify-notifications-api'
|
||||
@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))
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(port=6011)
|
||||
manager.run()
|
||||
|
||||
Reference in New Issue
Block a user