Skip to content
/ dhttpd Public
forked from kevmoo/dhttpd

A simple HTTP server that can serve up any directory, built with Dart.

License

Notifications You must be signed in to change notification settings

EP-u-NW/dhttpd

 
 

Repository files navigation

Pub Package CI

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

Install

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

$ 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 pub global command.

$ pub global run dhttpd

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

$ stagehand web-angular
$ pub get
$ pub 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.
    --cert=<cert>    The certificate to use.
                     If not set, https will not be used.
                     See the dart documentation about SecurityContext.useCertificateChain for more.
    --key=<key>      The key of the certificate to use.
                     If not set, https will not be used.
                     See the dart documentation about SecurityContext.usePrivateKey for more.
    --host=<host>    The hostname to listen on.
                     (defaults to "localhost")
-h, --help           Displays the help.

About

A simple HTTP server that can serve up any directory, built with Dart.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dart 100.0%