add health check endpoint

This commit is contained in:
codl 2017-10-15 20:38:39 +02:00
parent 4a2450e28f
commit 3d8c809e64
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 8 additions and 0 deletions

View File

@ -5,6 +5,14 @@ from model import Account
import libforget.settings
import libforget.json
@app.route('/api/health_check')
def health_check():
try:
db.session.execute('SELECT 1')
return 'ok'
except Exception:
return ('bad', 500)
@app.route('/api/settings', methods=('PUT',))
@require_auth_api