Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #38 from alphagov/backdrop-read-healthcheck
Browse files Browse the repository at this point in the history
Health check URL for backdrop read API
  • Loading branch information
robyoung committed Apr 4, 2013
2 parents 73b3b75 + 1592093 commit 2224d19
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backdrop/read/api.py
Expand Up @@ -84,6 +84,13 @@ def exception_handler(e):
app.logger.exception(e)
return jsonify(status='error', message=''), e.code

@app.route('/_status')
def health_check():
if db.alive():
return jsonify(status='ok', message='database seems fine')
else:
return jsonify(status='error',
message='cannot connect to database'), 500

@app.route('/<bucket_name>', methods=['GET'])
def query(bucket_name):
Expand Down

0 comments on commit 2224d19

Please sign in to comment.