Add Cloud9 development running support

This commit is contained in:
Jeremy Zhang 2017-03-31 07:34:06 +00:00
parent fdb3749d90
commit d3575a29d5
2 changed files with 12 additions and 4 deletions

6
run.py
View File

@ -1,9 +1,10 @@
#!/usr/bin/env python2 #!/usr/bin/env python2
from titanembeds.app import app from titanembeds.app import app
if __name__ == "__main__": def init_debug():
import os import os
from flask import jsonify, request from flask import jsonify, request
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib
# Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db
@ -29,5 +30,6 @@ if __name__ == "__main__":
decoded = None decoded = None
return jsonify(session_cookie=decoded) return jsonify(session_cookie=decoded)
if __name__ == "__main__":
init_debug()
app.run(host="0.0.0.0",port=3000,debug=True) app.run(host="0.0.0.0",port=3000,debug=True)

6
run_c9.py Normal file
View File

@ -0,0 +1,6 @@
from run import app, init_debug
import os
if __name__ == "__main__":
init_debug()
app.run(host=os.getenv('IP', '0.0.0.0'), port=int(os.getenv('PORT', 8080)), debug=True)