# pushstate-server

> Static file server that works with HTML5 Pushstate.

Latest version **3.1.0** (published 2019-02-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install pushstate-server
pnpm add pushstate-server
yarn add pushstate-server
bun add pushstate-server
```

Provides the command `pushstate-server`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.0 |
| Published | 2019-02-12 |
| First published | 2013-08-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 166.6 KB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 420 |
| Author | Scott Corgan |
| Maintainers | scottcorgan |
| Keywords | pushstate, html5, static, server |

## Links

- npm: https://www.npmjs.com/package/pushstate-server
- Repository: https://github.com/scottcorgan/pushstate-server
- Homepage: https://github.com/scottcorgan/pushstate-server#readme
- Issues: https://github.com/scottcorgan/pushstate-server/issues
- npm.io page: https://npm.io/package/pushstate-server

## Dependencies (5)

- [connect](https://npm.io/package/connect.md) 3.6.6
- [minimist](https://npm.io/package/minimist.md) 1.2.0
- [compression](https://npm.io/package/compression.md) 1.7.3
- [serve-static](https://npm.io/package/serve-static.md) 1.13.2
- [connect-static-file](https://npm.io/package/connect-static-file.md) 2.0.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 3.1.0 (latest) — 2019-02-12
- 3.0.1 — 2017-07-11
- 3.0.0 — 2017-03-02
- 2.2.2 — 2017-02-27
- 2.2.1 — 2017-02-03
- 2.2.0 — 2017-01-30
- 2.1.0 — 2016-09-27
- 2.0.0 — 2016-09-13
- 1.14.0 — 2016-09-02
- 1.13.0 — 2016-09-02
- 1.12.0 — 2016-08-29
- 1.11.0 — 2016-08-23
- 1.10.0 — 2016-08-14
- 1.9.0 — 2016-07-29
- 1.8.1 — 2015-11-25
- … 14 more at https://npm.io/package/pushstate-server/versions

## README

# pushstate-server

Static file server that works with HTML5 Pushstate.

For example, the route ` /some/pushstate/route ` will return the ` index.html ` file. But, ` /some/static/path/logo.png ` will return the ` logo.png ` static file.

## Install

```
npm install pushstate-server --save
```

## Usage

```js
var server = require('pushstate-server');

server.start({
  port: 3000,
  directory: './public'
});
```

or for multiple directories

```js
var server = require('pushstate-server');

server.start({
  port: 4200,
  directories: ['./public', './bower_components']
});
```

or bind to a particular host

```js
server.start({
  port: 4200,
  host: '192.99.100.01',
  directories: ['./public', './bower_components']
});
```


## Global Install

```
npm install -g pushstate-server
```

```
usage: pushstate-server [directory] [port] [file]
```

## API

#### start(options[, callback])
* start the pushstate static file server

##### options

* `port`
  * set the port that the server should open
  * uses ` process.env.PORT ` if not specified, and defaults to port ` 9000 ` if none is available
* `directory`
  * the path to the directory where the static assets will be served
  * defaults to ` public `
* `file`
  * Custom file to serve
  * defaults to `index.html`

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