Commit bf153ff6 authored by fangzhipeng's avatar fangzhipeng

根据环境判断配置

parent 80b041c0
from flask import Flask
from weather.service import weather
import socket
app = Flask(__name__)
......@@ -24,4 +25,8 @@ app.wsgi_app = PrefixMiddleware(app.wsgi_app, prefix='/api')
app.register_blueprint(weather)
if __name__ == '__main__':
app.run(debug=True)
\ No newline at end of file
hostname = socket.gethostname()
if (hostname == 'VM-151-99-ubuntu'):
app.run(port=9999)
else:
app.run(debug=True)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment