Greetings // Glitch Community
I’m from Accenture Team at Google [ Test/Support for api(dot)ai ]
Task-at-hand //
- Running https://github.com/api-ai/apiai-weather-webhook-sample on Glitch **
** (currently uses Heroku)
In Glitch //
- I went ahead and Remixed python-flask(dot)glitch(dot)me to get Flask up on Glitch – It works! Yay Glitch!
- I added the following dependency to my remix [ within
requirements.txt
] calledfuture 0.16.0
–
learn about future at pypi(dot)python(dot)org/pypi/future
Observations //
My Remix is currently public at API.ai Webhook and I’m about to test it . . .
Differences from Heroku // Within the following if statements block . . .
-
port
var is assigned return ofint( os.getenv(...) )
- ignoring print call in this topic
-
app.run
is called with three params
Reference statement // for Differences . . .
if __name__ == '__main__':
port = int(os.getenv('PORT', 5000))
print("Starting app on port %d" % port)
app.run(debug=False, port=port, host='0.0.0.0')
Differences from Heroku // Within the following if statements block . . .
-
app.run
is called with no params (for pure Python-Flask implementation not using external api)
if __name__ == "__main__":
app.run()