npm.io
3.13.2 • Published 2d ago

@allurereport/static-server

Licence
Apache-2.0
Version
3.13.2
Deps
2
Size
47 kB
Vulns
0
Weekly
0
Stars
321

Static Server

Allure Report logo


Overview

Minimalistic web-server for serving Allure Reports and static files with live reload support.

Install

Use your favorite package manager to install the package:

npm add @allurereport/static-server
yarn add @allurereport/static-server
pnpm add @allurereport/static-server

Usage

The server can be used programmatically only:

import { serve } from "@allurereport/static-server";

const server = await serve({
  // by default uses a random available port
  port: 8080,
  // path to the directory with files should be served
  servePath: "/path/to/your/static/files",
  // enable live reload
  live: true,
});

// reloads the served pages manually, even if live reload isn't enabled
await server.reload();
// stops the server
await server.stop();

Keywords