mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
Added healthcheck page
- used in ELB healthchecks
This commit is contained in:
@@ -19,6 +19,9 @@ def create_app(config_name):
|
||||
from .main import main as main_blueprint
|
||||
application.register_blueprint(main_blueprint)
|
||||
|
||||
from .status import status as status_blueprint
|
||||
application.register_blueprint(status_blueprint)
|
||||
|
||||
return application
|
||||
|
||||
|
||||
|
||||
7
app/main/views/healthcheck.py
Normal file
7
app/main/views/healthcheck.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from flask import jsonify
|
||||
from .. import main
|
||||
|
||||
|
||||
@main.route('/', methods=['GET'])
|
||||
def get_index():
|
||||
return jsonify(result="hello world"), 200
|
||||
5
app/status/__init__.py
Normal file
5
app/status/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from flask import Blueprint
|
||||
|
||||
status = Blueprint('status', __name__)
|
||||
|
||||
from app.status.views import healthcheck
|
||||
0
app/status/views/__init__.py
Normal file
0
app/status/views/__init__.py
Normal file
10
app/status/views/healthcheck.py
Normal file
10
app/status/views/healthcheck.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from flask import jsonify
|
||||
|
||||
from app.status import status
|
||||
|
||||
|
||||
@status.route('/_status')
|
||||
def status():
|
||||
return jsonify(
|
||||
status="ok",
|
||||
), 200
|
||||
@@ -2,3 +2,4 @@
|
||||
|
||||
echo "Stopping application"
|
||||
cd ~/notifications-api/;
|
||||
sudo service notifications-api stop
|
||||
Reference in New Issue
Block a user