4
如何在Express中获取URL参数?
我在tagid从URL:获取值方面遇到问题localhost:8888/p?tagid=1234。 帮助我更正我的控制器代码。我无法获得tagid价值。 我的代码如下: app.js: var express = require('express'), http = require('http'), path = require('path'); var app = express(); var controller = require('./controller')({ app: app }); // all environments app.configure(function() { app.set('port', process.env.PORT || 8888); app.use(express.json()); app.use(express.urlencoded()); app.use(express.methodOverride()); app.use(app.router); app.use(express.static(path.join(__dirname, 'public'))); app.set('view engine', 'jade'); app.set('views', __dirname + '/views'); app.use(app.router); app.get('/', function(req, …