# done-serve

> DoneJS development server

Latest version **3.3.1** (published 2019-01-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install done-serve
pnpm add done-serve
yarn add done-serve
bun add done-serve
```

Provides the command `done-serve`.

## 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.3.1 |
| Published | 2019-01-25 |
| First published | 2016-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Unpacked size | 25.7 KB |
| Known vulnerabilities | 0 (+3 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Bitovi |
| Maintainers | justinbmeyer, marshallswain, matthewp, phillipskevin |
| Keywords | DoneJS |

## Links

- npm: https://www.npmjs.com/package/done-serve
- Repository: https://github.com/donejs/done-serve
- Homepage: https://github.com/donejs/done-serve#readme
- Issues: https://github.com/donejs/done-serve/issues
- npm.io page: https://npm.io/package/done-serve

## Dependencies (14)

- [send](https://npm.io/package/send.md) ^0.16.2
- [chalk](https://npm.io/package/chalk.md) ^2.4.1
- [debug](https://npm.io/package/debug.md) ^2.6.3
- [cookie](https://npm.io/package/cookie.md) ^0.3.1
- [done-ssr](https://npm.io/package/done-ssr.md) ^3.0.0
- [commander](https://npm.io/package/commander.md) ^2.8.1
- [http-proxy](https://npm.io/package/http-proxy.md) ^1.13.2
- [compression](https://npm.io/package/compression.md) ^1.6.1
- [serve-index](https://npm.io/package/serve-index.md) ^1.9.1
- [kill-on-exit](https://npm.io/package/kill-on-exit.md) ^1.2.0
- [serve-static](https://npm.io/package/serve-static.md) ^1.13.2
- [path-to-regexp](https://npm.io/package/path-to-regexp.md) ^2.4.0
- [cookie-signature](https://npm.io/package/cookie-signature.md) ^1.1.0
- [donejs-error-format](https://npm.io/package/donejs-error-format.md) ^1.2.0

## Recent versions

- 3.3.1 (latest) — 2019-01-25
- 4.0.0-pre.0 (pre) — 2019-10-15
- 1.5.0-beta.0 (beta) — 2017-10-30
- 1.4.0-alpha.1 (alpha) — 2017-06-26
- 1.1.0-supercache.0 (supercache) — 2017-04-11
- 3.3.0 — 2019-01-07
- 3.2.0 — 2019-01-04
- 3.1.1-pre.0 — 2018-12-19
- 3.1.0 — 2018-12-13
- 3.0.0 — 2018-11-15
- 3.0.0-pre.4 — 2018-11-08
- 3.0.0-pre.3 — 2018-09-14
- 3.0.0-pre.2 — 2018-09-07
- 3.0.0-pre.1 — 2018-08-27
- 2.3.0 — 2018-06-28
- … 25 more at https://npm.io/package/done-serve/versions

## README

# done-serve

[![Join the chat at https://gitter.im/donejs/donejs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/donejs/donejs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/donejs/done-serve/blob/master/LICENSE.md)
[![npm version](https://badge.fury.io/js/done-serve.svg)](http://badge.fury.io/js/done-serve)
[![Build Status](https://travis-ci.org/donejs/done-serve.svg?branch=master)](https://travis-ci.org/donejs/done-serve)
[![Greenkeeper badge](https://badges.greenkeeper.io/donejs/done-serve.svg)](https://greenkeeper.io/)

A simple development server for DoneJS projects.

- [Install](#install)
- [Usage](#usage)
- [Options](#options)
  - <code>[-p, --port](#-p---port)</code>
  - <code>[-r, --proxy](#-r---proxy)</code>
  - <code>[-t, --proxy-to](#-t---proxy-to)</code>
  - <code>[--proxy-no-cert-check](#--proxy-no-cert-check)</code>
  - <code>[-d, --develop](#-d---develop)</code>
  - <code>[-l, --no-live-reload](#-l---no-live-reload)</code>
  - <code>[--live-reload-port](#--live-reload-port)</code>
  - <code>[-s, --static](#-s--static)</code>
  - <code>[--error-page](#--error-page)</code>
  - <code>[--timeout](#--timeout)</code>
  - <code>[--debug](#--debug)</code>
  - <code>[--key](#--key)</code>
  - <code>[--cert](#--cert)</code>
  - <code>[--strategy](#--strategy)</code>

## Install

```
npm install done-serve
```

## Usage

```
node_modules/.bin/done-serve [path] [options]
```

`[path]` is the root directory. Defaults to the current working directory.

To start a full server that hosts your application from the `./dist` directory on port `3030` run:

```
node_modules/.bin/done-serve dist --port 3030
```

## Options

The following `[options]` can be specified from the command line:

### -p, --port

Specify the **port** the server should run on. If unspecified this port will be one of:

* the `PORT` environment variable
* `3030`

### -r, --proxy

Proxy a local path (default: `/api`) to the given URL (e.g. `http://api.myapp.com`).

### -t, --proxy-to

Set the proxy endpoint (default: `/api`).

### --proxy-no-cert-check

Turn off SSL certificate verification.

### -d, --develop

Start a [live-reload](http://stealjs.com/docs/steal.live-reload.html) server so any code changes will be reflected immediately.

### -l, --no-live-reload

Disable [live-reload](http://stealjs.com/docs/steal.live-reload.html) when used with the `--develop` option.

### --live-reload-port

Specify the port (a `Number`) to use for live-reload. The default port is specified in the [LiveReloadOptions](https://stealjs.com/docs/steal.live-reload.options.html) documentation.

### -s, --static

Only serve static files, do not perform server-side rendering. Notably this is useful when debugging an issue in the app.

### --error-page <filename>

With the `--static` flag set, set an HTML page that should be sent instead of the normal error page. This is useful when you want to use Pushstate without server side rendering.

### --auth-cookie

Specifies the name of a cookie that [done-ssr](https://github.com/donejs/done-ssr#options) will use to enable JavaScript Web Token (JWT) auth.

### --auth-domains

A comma-separated string of domain names that are authorized to receive the JWT token.  Required if `--auth-cookie` is used.

### --timeout

Specify a timeout for server rendering. If the timeout is exceeded the server will return whatever has been rendered up until that point. (default: `5000`)

### --debug

Enable debug information in case of a timeout. The debug information will be appended to the document as a modal window and provides stack traces. Only use this flag during development.

### --key, --cert

Provide SSL key and certificate files. When providing these options both HTTP and HTTP2 servers will be set up, with automatic forwarding.

```shell
done-serve --static --key ~/.localhost-ssl/private.pem --cert ~/.localhost-ssl/cert.pem
```

### --strategy

Provides which rendering strategy to use. By default done-ssr waits for all asynchronous tasks to complete before serializing HTML and returning that to the browser. The options are:

* **safe**: The default strategy as described above.
* **incremental**: This rendering strategy prioritizes returning HTML to the browser sooner. Along with the HTML a shim is sent that communicates with the server to receive rendering instructions. This allows a faster rendering experience in browsers that support HTTP2. This strategy will silently fall back to the **safe** strategy if HTTP2 is not supported. Using this option requires also providing **--key** and **--cert** flags, as HTTP2 requires SSL.

## Usage in Node

You can also use the server, with the same options, from JavaScript:

```js
var server = require("done-serve");

server({
path: "path/to/dir"
});
```

## Changelog

See the [latest releases on GitHub](https://github.com/donejs/done-serve/releases).

## Contributing

The [DoneJS contribution guide](https://donejs.com/contributing.html) has information on getting help, reporting bugs, developing locally, and more.

## License

[MIT](https://github.com/donejs/done-serve/blob/master/LICENSE.md)

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