0.1.0 • Published 7 years ago

lazy-piggy v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

Lazy Piggy 🐷 Build Status

A simple web server for static sites with optional basic authentication

Why?

Perfect you need a simple static web server with basic authentication, such as for previewing a site under development.

Usage

Lazy Piggy can be used from the command line or from node. All options are available in all modes.

Options

OptionDescriptionDefault
rootRoot folder to serve.'public'
hostHostname to listen to.'localhost'
portPort to listen to.3000 or the environment variable PORT when available.
authBasic authentication configuration.
auth.realmBasic authentication realm.'Lazy Piggy'
auth.usersUser/Password map to accept. If not set, basic auth is turned off.undefined

Options can be specified as command line parameters, as an object, in an .lazypiggyrc file or as environment variables.

Command line

Run Lazy Piggy with:

$ lazy-piggy

Node API

Use Lazy Piggy in node like so:

const lazyPiggy = require('lazy-piggy')
// do other stuff and set options
// ...
// create and start server
const server = lazyPiggy(options)
// ...
// stop server
server.close()