我无法从浏览器获得http://127.0.0.1:5000/user1 Url每次它给404和http://127.0.0.1:5000它给旧的输出,我试过了(一些其他字符串“Hello瓶”),而不是“你好,世界” 我试过关闭我的IDE,并再次尝试,即使我已经创建了另一个项目,但问题仍然存在蟒蛇烧瓶应用程序路线不按预期工作
在此先感谢!
#imports
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'hello world!'
#add users to collection "app_users"
@app.route('/user1',methods=['POST'])
def add_user():
if not request.json or not 'email_id' in request.json:
abort(404)
print("processing")
insert(request)
return flask.jsonify({'status': "inserted successfully"}), 201
if __name__ == '__main__':
app.run()