New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@bayerjs/static

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bayerjs/static

Static files middleware

latest
Source
npmnpm
Version
0.3.0-alpha.1
Version published
Maintainers
1
Created
Source

@bayerjs/static

Static middleware for Bayer.js.

Note of caution

This is a pretty naive implementation, without proper MIME handling, or security concerns. It is mainly provided as a convinience function.

Usage

import Bayer from "@bayerjs/core";
import staticFiles from "@bayerjs/static";

const server = new Bayer();
server.use(staticFiles({ localPath: "../public" }));

The options object has the following structure:

/**
 * Options interface for the Bayer.js static middleware.
 */
export interface IBayerStaticOptions {
  /** Local path to the directory containing the */
  localPath: string;
  /** Whether to use the index file on directory hits */
  useIndexFile?: boolean; // default: true
  /** File to serve on directory hits, relative to the hit directory */
  indexFile?: string; // default: "index.html"
  /** Whether to enable SPA mode, which serves a file relative to localPath on 404 errors */
  spaMode?: boolean; // default: false
  /** File to serve on 404 errors */
  spaFile?: string; // default: "index.html"
}

Keywords

bayerjs

FAQs

Package last updated on 15 Mar 2019

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