1
0
Fork 0
peertube/routes/index.js
Chocobozzz 8c308c2bf7 Spawn
2015-10-29 23:14:54 +01:00

24 lines
540 B
JavaScript

;(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
})()