Total Complexity | 2 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from collections import OrderedDict |
||
2 | |||
3 | from flask import Blueprint, current_app |
||
4 | |||
5 | from .. import __version__ |
||
6 | |||
7 | from ._utils import route |
||
8 | |||
9 | |||
10 | blueprint = Blueprint('root', __name__) |
||
11 | |||
12 | |||
13 | @blueprint.route("/api/") |
||
14 | def get(): |
||
15 | """Generate memes from templates.""" |
||
16 | data = OrderedDict() |
||
17 | data['templates'] = route('templates.get', _external=True) |
||
18 | data['fonts'] = route('fonts.get', _external=True) |
||
19 | data['aliases'] = route('aliases.get', _external=True) |
||
20 | data['search'] = route('search.get', _external=True) |
||
21 | data['version'] = __version__ |
||
22 | data['changes'] = current_app.config['CHANGES_URL'] |
||
23 | return data |
||
24 | |||
25 | |||
26 | @blueprint.route("/CHECK") |
||
27 | def handle_checks(): |
||
28 | """Return CHECK_OK for zero-downtime deployment. |
||
29 | |||
30 | See: https://labnotes.org/zero-downtime-deploy-with-dokku |
||
31 | |||
32 | """ |
||
33 | return "CHECK_OK" |
||
34 |