2015-11-07 11:22:05 -06:00
|
|
|
;(function () {
|
|
|
|
'use strict'
|
|
|
|
|
|
|
|
function getPartial (req, res) {
|
|
|
|
var directory = req.params.directory
|
|
|
|
var name = req.params.name
|
|
|
|
|
|
|
|
res.render('partials/' + directory + '/' + name)
|
|
|
|
}
|
|
|
|
|
|
|
|
function getIndex (req, res) {
|
|
|
|
res.render('index')
|
|
|
|
}
|
|
|
|
|
|
|
|
var express = require('express')
|
2015-11-07 11:40:13 -06:00
|
|
|
var middleware = require('../middlewares').misc
|
2015-11-07 11:22:05 -06:00
|
|
|
|
|
|
|
var router = express.Router()
|
|
|
|
|
|
|
|
router.get('/partials/:directory/:name', middleware.cache(), getPartial)
|
|
|
|
router.get(/^\/(index)?$/, middleware.cache(), getIndex)
|
|
|
|
|
|
|
|
module.exports = router
|
|
|
|
})()
|