From 8c308c2bf7f658945d80be9d5880361238635f5b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 9 Jun 2015 17:41:40 +0200 Subject: Spawn --- routes/index.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 routes/index.js (limited to 'routes/index.js') diff --git a/routes/index.js b/routes/index.js new file mode 100644 index 000000000..690913a84 --- /dev/null +++ b/routes/index.js @@ -0,0 +1,24 @@ +;(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') + var middleware = require('../middlewares') + + var router = express.Router() + + router.get('/partials/:directory/:name', middleware.cache(), getPartial) + router.get(/^\/(index)?$/, middleware.cache(), getIndex) + + module.exports = router +})() -- cgit v1.2.3