UNPKG

@tlrg/middleware-js

Version:
15 lines (13 loc) 477 B
module.exports = function (req, res, next) { var cobrands = req.app.get('cobrandsConfig'); if (req.subdomains || req.query.cobrand) { var subdomain = req.query.cobrand || req.subdomains[req.subdomains.length - 1]; if (cobrands[subdomain]) { req.moonstick.brand = subdomain; req.moonstick.pcode = cobrands[subdomain].pcode; req.moonstick.domain = 'cobrands'; return next(); } } next(); };