mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-26 17:16:11 -05:00
17 lines
445 B
JavaScript
17 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);
|
||
|
};
|