dhttpd 4.0.1 icon indicating copy to clipboard operation
dhttpd: ^4.0.1 copied to clipboard

A static HTTP file server for easy local hosting of a directory.

Pub Package CI

A simple HTTP server that can serve up any directory, built with Dart. Inspired by python -m SimpleHTTPServer.

Install #

Use the dart pub global command to install this into your system.

$ dart pub global activate dhttpd

Use #

If you have modified your PATH, you can run this server from any local directory.

$ dhttpd

Otherwise you can use the dart pub global command.

$ dart pub global run dhttpd

Here's an example of creating a web app and then running it with this server:

$ dart create -t web-simple web-app
$ cd web-app
$ dart pub get
$ dart run build_runner build -o build
$ dhttpd --path build/web/  # Serves app at http://localhost:8080

Configure #

$ dhttpd --help
-p, --port=<port>    The port to listen on.
                     (defaults to "8080")
    --path=<path>    The path to serve. If not set, the current directory is used.
    --host=<host>    The hostname to listen on.
                     (defaults to "localhost")
-h, --help           Displays the help.
63
likes
120
pub points
81%
popularity

Publisher

verified publisher iconj832.com

A static HTTP file server for easy local hosting of a directory.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.BSD-3-Clause (LICENSE)

Dependencies

args, build_cli_annotations, shelf, shelf_static

More

Packages that depend on dhttpd