How to use the serve function in serve

To help you get started, we’ve selected a few serve 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 intuit / Ignite / src / watch.js View on Github external
function startServer(dist, port) {
  server = serve(dist, {
    silent: true,
    port,
    ignore: ['node_modules']
  });
}
github phenomic / phenomic / packages / core / src / index.js View on Github external
async preview(inputConfig?: PhenomicInputConfig) {
    try {
      const config = await normalizeConfiguration(inputConfig);
      await build(config);
      log(
        `⚡️ Serving on http://localhost:${config.port}` +
          config.baseUrl.pathname,
      );
      serve(config.outdir, {
        port: config.port,
      });
    } catch (e) {
      handleError(e);
    }
  },
};

serve

Static file serving and directory listing

MIT
Latest version published 1 month ago

Package Health Score

91 / 100
Full package analysis