How to use local-web-server - 1 common examples

To help you get started, we’ve selected a few local-web-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tiagomapmarques / js-boilerplate / config / common / add-server.js View on Github external
const serve = (port, open, spa, https) => {
  LocalWebServer.create({
    port,
    https,
    compress: true,
    directory: 'public',
    spa: spa ? 'index.html' : undefined,
  });

  const ipList = Object.keys(os.networkInterfaces())
    .map((key) => os.networkInterfaces()[key])
    .reduce(reduceFlatten, [])
    .filter((networkInterface) => networkInterface.family === 'IPv4')
    .map((networkInterface) => networkInterface.address);

  ipList.unshift(os.hostname());
  const urls = ipList.map((address) => `http${https ? 's' : ''}://${address}:${port}`);

local-web-server

A lean, modular web server for rapid full-stack development

MIT
Latest version published 4 months ago

Package Health Score

67 / 100
Full package analysis

Popular local-web-server functions