clay / amphora

Middleware for Express that composes components into renderable pages
https://claycms.gitbooks.io/amphora/
MIT License
31 stars 23 forks source link

Site Middleware #622

Closed yuliyv closed 5 years ago

yuliyv commented 5 years ago

Add middleware configuration at the site router level. Supports path specific middleware, and site level middleware.

Site Specific Middleware (applies to ALL routes including amphora specified routes

module.exports.middleware = [
  (req, res, next) => {
    console.log(req.headers);
    next();
  }
]

Route Specific Middleware

module.exports.routes = [
  {
    path: '/',
    middleware: [
      (req, res, next) => {
        console.log(req.headers);
        next();
      }
    ]
]
coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 2061


Totals Coverage Status
Change from base Build 2060: 0.0%
Covered Lines: 4431
Relevant Lines: 4431

💛 - Coveralls