suchen

Heim  >  Fragen und Antworten  >  Hauptteil

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要导入其他?

PHP中文网PHP中文网2785 Tage vor865

Antworte allen(1)Ich werde antworten

  • 巴扎黑

    巴扎黑2017-04-17 15:42:45

    http://expressjs.com/en/4x/ap...

    query 文档好像是这么写的

    // GET /search?q=tobi+ferret
    req.query.q
    // => "tobi ferret"

    Antwort
    0
  • StornierenAntwort