# lazy-piggy

> A simple web server for static sites with optional basic authentication

Latest version **0.1.0** (published 2017-03-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install lazy-piggy
pnpm add lazy-piggy
yarn add lazy-piggy
bun add lazy-piggy
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2017-03-22 |
| First published | 2017-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=5.12.0 |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Daniel Hägglund |
| Maintainers | judas-christ |
| Keywords | web-server, static, basic-auth |

## Links

- npm: https://www.npmjs.com/package/lazy-piggy
- Repository: https://github.com/judas-christ/lazy-piggy
- Homepage: https://github.com/judas-christ/lazy-piggy#readme
- Issues: https://github.com/judas-christ/lazy-piggy/issues
- npm.io page: https://npm.io/package/lazy-piggy

## Dependencies (5)

- [rc](https://npm.io/package/rc.md) ^1.1.7
- [connect](https://npm.io/package/connect.md) ^3.6.0
- [basic-auth](https://npm.io/package/basic-auth.md) ^1.1.0
- [compression](https://npm.io/package/compression.md) ^1.6.2
- [serve-static](https://npm.io/package/serve-static.md) ^1.12.1

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2017-03-22

## README

# Lazy Piggy 🐷 [![Build Status](https://travis-ci.org/judas-christ/lazy-piggy.svg?branch=master)](https://travis-ci.org/judas-christ/lazy-piggy)

> 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

|Option  | Description | Default |
|-|-|-|
| `root` | Root folder to serve. | `'public'`
| `host` | Hostname to listen to. | `'localhost'`
| `port` | Port to listen to. | `3000` or the environment variable `PORT` when available.
| `auth` | Basic authentication configuration. |
| `auth.realm` | Basic authentication realm. | `'Lazy Piggy'`
| `auth.users` | User/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:

```bash
$ lazy-piggy
```

### Node API

Use Lazy Piggy in node like so:

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

---
_Source: https://npm.io/package/lazy-piggy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
