Skip to content

Instantly share code, notes, and snippets.

@twyle
Last active May 13, 2022 07:29
Show Gist options
  • Save twyle/ab256e8baf6afa249f700bbae0282edf to your computer and use it in GitHub Desktop.
Save twyle/ab256e8baf6afa249f700bbae0282edf to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
"""This module creates the routes for our API."""
from API import app
@app.route('/api/v1', methods=['GET'])
@app.route('/', methods=['GET'])
def api_home() -> dict:
"""Handle get requests to /api/v1 route.
Returns
-------
dict:
A dictionary showing:
{
'data': 'Hello from shileds.io json endpoint'
}
"""
data = {
'data': 'Hello from shileds.io json endpoint'
}
return data, 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment