Comments (8)
Does this also work in page.js ? if so, needs documenting...
from expressjs.com.
nope
from expressjs.com.
never mind, might be a nice feature some time.
from expressjs.com.
Is this still a thing?
from expressjs.com.
imo this is a weird feature. easier just to have users change req.url
or something.
from expressjs.com.
It's actually really useful, and nothing like changing req.url. The use case is something like the following:
app.get('/', user.can('view admin home page').here, function (req, res, next) {
res.render('admin-home-page');
});
app.get('/', function (req, res, next) {
res.render('normal-home-page');
});
The user.can('view admin home page').here
acts as a guard for that handler, but allows other handlers further down the chain to still work if need be.
from expressjs.com.
A regular next() would do the same thing here now.
On Mar 6, 2014 5:42 AM, "Forbes Lindesay" [email protected] wrote:
It's actually really useful, and nothing like changing req.url. The use
case is something like the following:app.get('/', user.can('view admin home page').here, function (req, res, next) {
res.render('admin-home-page');});app.get('/', function (req, res, next) {
res.render('normal-home-page');});The user.can('view admin home page').here acts as a guard for that
handler, but allows other handlers further down the chain to still work if
need be.Reply to this email directly or view it on GitHubhttps://github.com//issues/48#issuecomment-36843605
.
from expressjs.com.
After almost two years, we can finally close this.
560f587
from expressjs.com.
Related Issues (20)
- deno support HOT 2
- Document customizing `express.json()` size limit for specific routes HOT 1
- Got error when installing expressjs.com locally HOT 2
- Incorrect default value for dotfiles in docs for express.static HOT 1
- Express is made of many modules - Broken Link: ExpressJS StatusBoard HOT 1
- Debugging guide references DEBUG_FD environment variable which was removed from node debug module HOT 3
- How to set debug mode on Windows? HOT 2
- Res.Render documentation missing information. HOT 1
- How to flush a response? HOT 1
- Update 5.0 version in Migration Guide HOT 1
- Update security and performance best practices HOT 2
- Release change log page does not show the latest 2 versions HOT 4
- State minimum required version of Node.js HOT 4
- Review and Update v5.x Documentation against v4.x HOT 1
- Proposal to map out outdated translations HOT 1
- Add blog HOT 5
- Expand CI functionality to preview changes from PR HOT 3
- Broken link / domain squatter link on homepage HOT 2
- Nav links do not reppear after resizing HOT 2
- Ideas for blog content HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expressjs.com.