from flask import Flask from flask_restful import Resource, Api def create_app(): app = Flask(__name__) CORS(app) api = Api(app) api.add_resource(HelloWorld, '/hello') return app if __name__ == '__main__': app = create_app() app.run(debug=True)