Skip to content

nheise/static-app-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published