mns-fe-server
Here is some sample server configuration:
/**
* © 2018 Marks and Spencer plc. All Rights Reserved.
* The trademark used in these materials are the properties of their respective owners.
* This work is protected by copyright law and contains valuable trade secrets and confidential information
*/
const indexFile = require('mns-core-ui-header');
const ExposeRoutes = indexFile.ExposeRoutes;
module.exports = {
routesDir: (server) => {
server.get('/', (req, res) => {
res.end('Hello world');
});
},
assetsDir: '/assets',
ExposeRoutes,
logger: false,
jsonLogging: () => {
return (req, res, next) => {
next();
};
},
pageNotFoundHandler: (req, res) => {
res.send('M&S - 404 Error');
},
errorPageHandler: (req, res) => {
res.send('M&S - 500 Error');
},
handlebars: {
viewsDir: __dirname + '/views/pages',
partialsDir: [
__dirname + '/views/partials',
__dirname + '/views/partials/layouts',
{
dir: 'node_modules/mns-core-ui/dist/templates/navigation/partials',
namespace: 'templates/navigation/partials'
}
]
}
};