1 Star 0 Fork 0

敏哥/flask-web

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
2route.py 495 Bytes
一键复制 编辑 原始数据 按行查看 历史
敏哥 提交于 5个月前 . 完善上下文
from flask import Flask
app = Flask(__name__)
SERVER_PORT=9999
@app.route('/')
def index():
return '<h1>Hello Flask!</h1>'
# http://localhost:9999/user/wxmgcs
@app.route('/user/<name>')
def user(name):
return '<h1>Hello, {}!</h1>'.format(name)
# http://localhost:9999/user/1
@app.route('/user/<int:id>')
def query_user(id):
return '<h1>获取的id是: {}</h1>'.format(id)
print(app.url_map)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=SERVER_PORT, debug=True)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/PatrickW/flask-web.git
git@gitee.com:PatrickW/flask-web.git
PatrickW
flask-web
flask-web
master

搜索帮助