blob: 1d4382d4829d2a8e33f91c92af93ea03c8f15201 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
"""Version 1 API blueprint."""
from flask import Blueprint, url_for, jsonify, make_response
from .species import speciesbp
v1 = Blueprint("v1", __name__)
v1.register_blueprint(speciesbp, url_prefix="/species")
@v1.route("/", methods=["GET"])
def index():
return make_response(jsonify({
"message": (
"This is v1 of the API. It's more hierarchical that the unversioned"
" variant."),
"links": {
"self": url_for("v1.index"),
"species": url_for("v1.species.list_species")
}
}), 200)
|