Test Python Google Cloud Functions locally

后端 未结 4 1574
一个人的身影
一个人的身影 2021-02-01 04:24

I\'m trying out the Python3.7 runtime on Google Cloud Functions. I am able to deploy the functions and make them work once deployed, however, I can\'t seem to run the emulator t

4条回答
  •  失恋的感觉
    2021-02-01 04:50

    To run it in IntelliJ with Target Type = Script Path and the default options it should look like this:

    from flask import Flask, request
    app = Flask(__name__)
    
    
    @app.route('/')
    def hello():
        return hello_get(request)
    
    if __name__ == '__main__':
        app.run('127.0.0.1', debug=True)
    

提交回复
热议问题