Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

req.baseUrl is more right for current express version (3.x) #397

Merged
merged 1 commit into from
Nov 7, 2014

Conversation

vhain
Copy link
Contributor

@vhain vhain commented Aug 25, 2014

app.mountpath for 4.x

this code is more reliable for following situation:

express 4.x app with kue app (express 3.x)

var express = require('express');
var app = express();
var router = express.Router();
var kue = require('kue');
router.use('/some/where/watchtower', auth.mid.requirePermission(Permission.TO.Watch), kue.app);

in case of upgrading kue's express 3.x to 4.x,

res.redirect(app.mountpath + '/active');

rather than

res.redirect(req.baseUrl+'/active');

will be more durable.

@qw3r
Copy link

qw3r commented Oct 2, 2014

+1

behrad added a commit that referenced this pull request Nov 7, 2014
req.baseUrl is more right for current express version (3.x)
@behrad behrad merged commit 2c11e6c into Automattic:master Nov 7, 2014
@behrad behrad removed the in progress label Nov 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants