Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

static-app-server

nheise5MIT0.1.1

Serve static files via nodejs express. HTML requests will always return index.html. Other types respond 404, if the file is not present.

web, rest, restful, app, static, files

readme

static-app-server

Usage | API

Serve static files via nodejs express. HTML requests will return a default HTML file, if the URL points to a location which not exists. Other file types respond 404, if the file is not present.

Usage

var options = { port: 8080, path: 'tests/dist/' };
var server = require("static-app-server")( [ options ] );

API

http.Server createServer( options )

Creates a Nodejs http.Server Object with the given options.

Option Description Type Default
port Port the server listen to int 8080
path Path to the static files to serve, relative to the execution directory. String dist
defaultFile Default html response. Must be in path. String /index.html