DoneJS development server
Switch branches/tags
0.2-legacy chasenlehara-patch-1 curses greenkeeper/can-component-4.1.0 greenkeeper/can-component-4.1.1 greenkeeper/can-component-4.4.4 greenkeeper/can-component-4.4.5 greenkeeper/can-component-4.4.6 greenkeeper/can-component-4.4.7 greenkeeper/can-component-4.4.8 greenkeeper/can-component-4.4.9 greenkeeper/can-component-4.4.10 greenkeeper/can-component-pin-4.0.8 greenkeeper/can-component-pin-4.4.4 greenkeeper/can-define-2.7.1 greenkeeper/can-define-2.7.2 greenkeeper/can-define-2.7.3 greenkeeper/can-define-2.7.4 greenkeeper/can-define-2.7.5 greenkeeper/can-route-4.4.0 greenkeeper/can-route-4.4.1 greenkeeper/can-route-4.4.2 greenkeeper/can-route-4.4.3 greenkeeper/can-route-4.4.4 greenkeeper/can-route-4.4.5 greenkeeper/can-route-4.4.6 greenkeeper/can-route-pin-4.3.12 greenkeeper/can-route-pushstate-4.0.5 greenkeeper/can-route-pushstate-4.1.0 greenkeeper/can-route-pushstate-4.1.1 greenkeeper/can-route-pushstate-5.0.0 greenkeeper/can-route-pushstate-5.0.1 greenkeeper/can-route-pushstate-5.0.2 greenkeeper/can-route-pushstate-5.0.3 greenkeeper/can-route-pushstate-5.0.4 greenkeeper/can-route-pushstate-5.0.5 greenkeeper/can-route-pushstate-5.0.6 greenkeeper/can-route-pushstate-5.0.7 greenkeeper/can-route-pushstate-5.0.8 greenkeeper/can-route-pushstate-5.0.9 greenkeeper/can-route-pushstate-pin-4.0.4 greenkeeper/commander-2.10.0 greenkeeper/commander-2.11.0 greenkeeper/commander-2.12.2 greenkeeper/commander-pin-2.9.0 greenkeeper/commander-pin-2.12.1 greenkeeper/compression-1.7.0 greenkeeper/compression-pin-1.6.2 greenkeeper/copy-dir-0.4.0 greenkeeper/debug-3.0.0 greenkeeper/debug-3.0.1 greenkeeper/debug-3.1.0 greenkeeper/debug-3.2.0 greenkeeper/debug-3.2.1 greenkeeper/debug-3.2.2 greenkeeper/debug-3.2.3 greenkeeper/debug-4.0.0 greenkeeper/debug-4.0.1 greenkeeper/debug-4.1.0 greenkeeper/done-autorender-2.4.0 greenkeeper/done-autorender-2.4.3 greenkeeper/done-autorender-2.5.0 greenkeeper/done-autorender-2.5.1 greenkeeper/done-autorender-pin-2.4.3 greenkeeper/done-ssr-3.0.1 greenkeeper/done-ssr-3.0.2 greenkeeper/done-ssr-pin-3.0.0 greenkeeper/is-ci-2.0.0 greenkeeper/jquery-3.3.1 greenkeeper/jquery-pin-3.3.0 greenkeeper/jshint-2.9.7 greenkeeper/jshint-pin-2.9.6 greenkeeper/nock-9.0.14 greenkeeper/nock-9.0.28 greenkeeper/nock-9.1.0 greenkeeper/nock-9.1.1 greenkeeper/nock-9.1.2 greenkeeper/nock-9.1.3 greenkeeper/nock-9.1.4 greenkeeper/nock-9.1.6 greenkeeper/nock-10.0.0 greenkeeper/nock-10.0.1 greenkeeper/nock-10.0.2 greenkeeper/nock-10.0.3 greenkeeper/nock-10.0.4 greenkeeper/nock-pin-9.0.13 greenkeeper/nock-pin-9.0.27 greenkeeper/nock-pin-9.1.5 greenkeeper/spawn-mochas-2.0.0 greenkeeper/steal-css-1.2.5 greenkeeper/steal-css-1.3.0 greenkeeper/steal-css-1.3.1 greenkeeper/steal-css-1.3.2 greenkeeper/steal-css-pin-1.2.4 greenkeeper/steal-css-pin-1.3.1 greenkeeper/steal-tools-1.3.6 greenkeeper/steal-tools-1.4.0 greenkeeper/steal-tools-1.4.1 greenkeeper/steal-tools-1.5.0 greenkeeper/steal-tools-1.6.0 greenkeeper/steal-tools-1.7.0 greenkeeper/steal-tools-1.7.1 greenkeeper/steal-tools-1.7.2 greenkeeper/steal-tools-1.8.0 greenkeeper/steal-tools-1.8.1 greenkeeper/steal-tools-1.8.2 greenkeeper/steal-tools-1.8.3 greenkeeper/steal-tools-1.8.4 greenkeeper/steal-tools-1.9.2 greenkeeper/steal-tools-1.9.3 greenkeeper/steal-tools-1.10.0 greenkeeper/steal-tools-1.10.1 greenkeeper/steal-tools-1.10.2 greenkeeper/steal-tools-1.11.0 greenkeeper/steal-tools-1.11.1 greenkeeper/steal-tools-1.11.2 greenkeeper/steal-tools-1.11.3 greenkeeper/steal-tools-2.0.0 greenkeeper/steal-tools-2.0.1 greenkeeper/steal-tools-2.0.2 greenkeeper/steal-tools-2.0.3 greenkeeper/steal-tools-2.0.4 greenkeeper/steal-tools-2.0.5 greenkeeper/steal-tools-2.0.6 greenkeeper/steal-tools-2.0.7 greenkeeper/steal-tools-2.0.8 greenkeeper/steal-tools-2.0.9 greenkeeper/steal-tools-2.0.10 greenkeeper/steal-tools-2.0.11 greenkeeper/steal-tools-pin-1.3.5 greenkeeper/steal-tools-pin-1.9.1 greenkeeper/steal-tools-pin-1.10.0 greenkeeper/testdouble-3.2.0 greenkeeper/testdouble-3.2.1 greenkeeper/testdouble-3.2.2 greenkeeper/testdouble-3.2.3 greenkeeper/testdouble-3.2.4 greenkeeper/testdouble-3.2.5 greenkeeper/testdouble-3.3.5 greenkeeper/testdouble-3.4.0 greenkeeper/testdouble-3.5.0 greenkeeper/testdouble-pin-3.1.1 greenkeeper/testdouble-pin-3.3.4 greenkeeper/update-to-node-10 major master old-master supercache
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
lib
scripts
test
.editorconfig
.gitignore
.jshintrc
.npmignore
.npmrc
.travis.yml
LICENSE.md
README.md
appveyor.yml
package.json

README.md

done-serve

Join the chat at https://gitter.im/donejs/donejs License: MIT npm version Build Status Greenkeeper badge

A simple development server for DoneJS projects.

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 server so any code changes will be reflected immediately.

-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

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 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.

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:

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

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

Changelog

See the latest releases on GitHub.

Contributing

The DoneJS contribution guide has information on getting help, reporting bugs, developing locally, and more.

License

MIT