Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mands/mns-fe-server

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mands/mns-fe-server

A server, wrapping Express for use within M&S front-end projects.

  • 1.1.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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'
            }
        ]
    }
};

FAQs

Package last updated on 22 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc