from services import app, api import os if __name__ == '__main__': port = int(os.environ.get('PORT', '5000')) debug = bool(os.environ.get('DEBUG', 'False').lower() == 'true') app.run(host='0.0.0.0', port=port, debug=debug)
from services import app if __name__ == "__main__": app.run() #app.run(debug=True, host="0.0.0.0")
@app.errorhandler(400) def bad_request(error): return response(code=RetCode.PARAMS_ERROR) @app.errorhandler(404) def api_not_found(error): return response(code=RetCode.ENTRY_NOT_FOUND) @app.errorhandler(500) def server_error(error): data = { 'sentry_event_id': g.sentry_event_id, 'public_dsn': sentry.client.get_public_dsn('http'), 'error': str(error) } return response(data, RetCode.SERVER_ERROR) @app.route('/') def hello_world(): return response(data='Hello!') app.register_blueprint(message_api, url_prefix='/demo') if __name__ == '__main__': app.run()
from services import app if __name__ == "__main__": app.run(host="0.0.0.0", debug=True)
#! /usr/bin/env python from services import app app.config.from_object('config') if __name__ == "__main__": app.run(debug=True, host='192.168.0.174' )
from services import app app.run(host='0.0.0.0', port=int("7001"), debug=True, threaded=True)
def runserver(host, port, debug): app.run(host=host, port=port, debug=debug)
from services import app app.run(debug=True)