You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
775 B
27 lines
775 B
5 years ago
|
/*
|
||
|
* HomeLogger Middleware
|
||
|
* -------------------------------------------------------------
|
||
|
* This is a sample middleware. It simply prints a console message when
|
||
|
* the route that it is tied to is accessed. By default, it is called if
|
||
|
* the '/' route is accessed. It can be injected in routes globally using
|
||
|
* the global mw() function.
|
||
|
*/
|
||
|
class HomeLogger {
|
||
|
|
||
|
/*
|
||
|
* Run the middleware test.
|
||
|
* This method is required by all Flitter middleware.
|
||
|
* It should either call the next function in the stack,
|
||
|
* or it should handle the response accordingly.
|
||
|
*/
|
||
|
test(req, res, next){
|
||
|
console.log("Home was accessed!")
|
||
|
|
||
|
/*
|
||
|
* Call the next function in the stack.
|
||
|
*/
|
||
|
next()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = HomeLogger
|