mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 23:27:54 -05:00
16 lines
445 B
JavaScript
16 lines
445 B
JavaScript
var defaults = require('lodash.defaults');
|
|
var fs = require('fs');
|
|
var mustache = require('mustache');
|
|
var path = require('path');
|
|
|
|
var config = require('./config');
|
|
|
|
module.exports = function (route) {
|
|
// Route definition
|
|
defaults(route, config);
|
|
|
|
// Render template
|
|
var location = path.resolve(__dirname, './template.html');
|
|
var template = fs.readFileSync(location, 'utf8');
|
|
return mustache.render(template, route);
|
|
};
|