From 0a6ee847b254d42cbfb453fe73cfe1503ae89a9a Mon Sep 17 00:00:00 2001 From: xuoutput <847438919@qq.com> Date: Sat, 1 Apr 2023 16:48:04 +0800 Subject: [PATCH] docs(express): update optional params id to who MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整 req.params 使用的参数值从 id 改为 who --- nodejs/express.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs/express.md b/nodejs/express.md index 2652502a..d44bf57b 100644 --- a/nodejs/express.md +++ b/nodejs/express.md @@ -333,7 +333,7 @@ app.get("/hello/:who", function(req, res) { {% highlight javascript %} app.get('/hello/:who?',function(req,res) { - if(req.params.id) { + if(req.params.who) { res.end("Hello, " + req.params.who + "."); } else {