node.js - req.query is not a function
本文介绍了node.js - req.query is not a function的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
var express = require('express');
var app = new express();
//http://localhost:3000/article?id=1
app.get('/article',function(req, res) {
var aId = req.query("id");
}
报错 TypeError: req.query is not a function
使用req.query要导入其他?
解决方案
http://expressjs.com/en/4x/ap...
query 文档好像是这么写的
// GET /search?q=tobi+ferret
req.query.q
// => "tobi ferret"
这篇关于node.js - req.query is not a function的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文