UNPKG

generator-ngfs

Version:

Yeoman generator for creating MEAN stack applications, using MongoDB, Express, AngularJS, and Node

26 lines (22 loc) 460 B
'use strict'; var path = require('path'); /** * Send partial, or 404 if it doesn't exist */ exports.partials = function(req, res) { var stripped = req.url.split('.')[0]; var requestedView = path.join('./', stripped); res.render(requestedView, function(err, html) { if(err) { res.send(404); } else { res.send(html); } }); }; /** * Send our single page app */ exports.index = function(req, res) { res.render('index'); };