I'm quite new to Node.js (and also KrakenJS) so sorry if it is a noobie question:
Trying to do it with new KrakenJS instance with :
index.js
var kraken = require('kraken-js');
var test = require('./lib/middlewares/test');
var app = require('express')();
app.requestBeforeRoute = function requestBeforeRoute(server) {
server.use(test());
console.log("Whateva");
};
app.use(kraken(options));
app.listen(port, function (err) {
console.log('[%s] Listening on http://localhost:%d', app.settings.env, port);
});
test.js is simply:
'use strict';
module.exports = function(req, res, next){
console.log("something with my new middleware");
next();
};
and i there is nothing in my console.
I'm quite new to Node.js (and also KrakenJS) so sorry if it is a noobie question:
Trying to do it with new KrakenJS instance with :
index.js
var kraken = require('kraken-js');
var test = require('./lib/middlewares/test');
var app = require('express')();
app.requestBeforeRoute = function requestBeforeRoute(server) {
server.use(test());
console.log("Whateva");
};
app.use(kraken(options));
app.listen(port, function (err) {
console.log('[%s] Listening on http://localhost:%d', app.settings.env, port);
});
test.js is simply:
'use strict';
module.exports = function(req, res, next){
console.log("something with my new middleware");
next();
};
and i there is nothing in my console.