static-app-server

0.1.1 • Public • Published

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

/static-app-server/

    Package Sidebar

    Install

    npm i static-app-server

    Weekly Downloads

    0

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • nheise