A simple HTTP server that can serve up any directory, built with Dart.
python -m SimpleHTTPServer.
pub global command to install this into your system.
$ pub global activate dhttpd
If you have modified your PATH, you can run this server from any local directory.
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
$ dhttpd --help -p, --port=<port> The port to listen on. (defaults to "8080") --path=<path> The path to serve. If not set, the curret directory is used. --host=<host> The hostname to listen on. (defaults to "localhost") -h, --help Displays the help.
- Updated a number of dependencies.
- Set Dart SDK constraint to '>=2.0.0-dev.48.0 <3.0.0'.
- Removed top-level fields
allow-originflag. In reality, this flag never worked because the
shelfpipeline was not configured correctly.
Source moved to github.com/kevmoo/dhttpd.
- No change in functionality, just version and doc tweaks.
- Fixed bug with setting the path from the command line.
- Start the server with
hostcommand-line flag, to set the hostname to listen on. Defaults to
allow-origincommand-line flag for CORS headers. Thanks to @gmosx for the patch.
Use this package as an executable
1. Install it
You can install the package from the command line:
$ pub global activate dhttpd
2. Use it
The package has the following executables:
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies: dhttpd: ^3.0.1
2. Install it
You can install packages from the command line:
$ pub get
$ flutter pub get
Alternatively, your editor might support
pub get or
flutter pub get.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Jan 20, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.7.0
- pana: 0.13.4
Health issues and suggestions
Document public APIs. (-1 points)
8 out of 8 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.
lib/src/options.g.dart. (-1.49 points)
lib/src/options.g.dart reported 3 hints:
line 11 col 11: Unnecessary new keyword.
line 14 col 52: Unnecessary new keyword.
line 36 col 52: Unnecessary new keyword.
lib/dhttpd.dart. (-0.50 points)
lib/dhttpd.dart reported 1 hint:
line 31 col 12: Unnecessary new keyword.
Package is getting outdated. (-23.84 points)
The package was last published 64 weeks ago.
Maintain an example. (-10 points)
Create a short demo in the
example/ directory to show how to use this package.
Common filename patterns include
dhttpd.dart. Packages with multiple examples should provide
For more information see the pub package layout conventions.
The package description is too short. (-7 points)
Add more detail to the
description field of
pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.
|Dart SDK||>=2.0.0 <3.0.0|