fix(mixins): Add locale/api and active link

This commit is contained in:
Khaled Garbaya
2017-09-28 13:51:53 +02:00
committed by Benedikt Rötsch
parent 07c5cc77b0
commit 713f554609
9 changed files with 32 additions and 25 deletions

6
app.js
View File

@@ -1,5 +1,6 @@
require('dotenv').config({ path: 'variables.env' })
const express = require('express')
const url = require('url')
const path = require('path')
const helpers = require('./helpers')
// const favicon = require('serve-favicon')
@@ -31,6 +32,11 @@ app.use(express.static(path.join(__dirname, 'public')))
// Pass custo helpers to all our templates
app.use(function (req, res, next) {
res.locals.helpers = helpers
const qs = url.parse(req.url).query
res.locals.queryString = qs ? `?${qs}` : ''
res.locals.query = req.query
res.locals.currentPath = req.path
console.log(req.path)
next()
})