Created
December 19, 2017 11:39
-
-
Save juhosa/c7c05d878e039e058d8bc9b4e6f9dfae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask_restful import Resource, Api | |
app = Flask(__name__) | |
api = Api(app) | |
class {{ resource_name }}(Resource): | |
def get(self): | |
return {'hello': 'world'} | |
{% if health_check == 'yes' %} | |
class HealthCheck(Resource): | |
def get(self): | |
return {} | |
{% endif %} | |
api.add_resource({{ resource_name }}, '/') | |
{% if health_check == 'yes' %} | |
api.add_resource(HealthCheck, '/health') | |
{% endif %} | |
if __name__ == '__main__': | |
app.run(debug = True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment