1
在deploying middleware example,中間件是使用海怪像下面如何在krakenjs中爲特定路線使用中間件?
// index.js
...
app.requestBeforeRoute = function requestBeforeRoute(server) {
server.use(millionsServed());
...
};
但是這樣一來,中間件應用在應用程序的所有路由。假設我只想將它應用於像這樣的特定路線:
app.get('/user', helpers.ensureAuthenticated, userCtrl.index);
我該怎麼做kraken?