dhttpd 3.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 62

Build Status

A simple HTTP 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 curret directory is used.
    --host=<host>    The hostname to listen on.
                     (defaults to "localhost")

-h, --help           Displays the help.

3.0.1 #

  • Updated a number of dependencies.

3.0.0 #

  • Set Dart SDK constraint to '>=2.0.0-dev.48.0 <3.0.0'.
  • Removed top-level fields DEFAULT_PORT and DEFAULT_HOST from library.

2.0.0 #

  • Removed allow-origin flag. In reality, this flag never worked because the shelf pipeline was not configured correctly.

  • Source moved to github.com/kevmoo/dhttpd.

1.0.0 #

  • No change in functionality, just version and doc tweaks.

0.3.1 #

  • Fixed bug with setting the path from the command line.
  • Start the server with dhttpd.

0.3.0 #

  • New host command-line flag, to set the hostname to listen on. Defaults to localhost

0.2.0 #

  • New allow-origin command-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:


$ dhttpd

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:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dhttpd/dhttpd.dart';
  
Version Uploaded Documentation Archive
3.0.1 Oct 24, 2018 Go to the documentation of dhttpd 3.0.1 Download dhttpd 3.0.1 archive
3.0.0 Jul 16, 2018 Go to the documentation of dhttpd 3.0.0 Download dhttpd 3.0.0 archive
2.0.0 Mar 5, 2018 Go to the documentation of dhttpd 2.0.0 Download dhttpd 2.0.0 archive
0.3.1 Sep 20, 2015 Go to the documentation of dhttpd 0.3.1 Download dhttpd 0.3.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
31
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
83
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Apr 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: Flutter, other

Primary library: package:dhttpd/dhttpd.dart with components: io.

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.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and dhttpd.dart. Packages with multiple examples should provide example/README.md.

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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args >=0.12.0+1 <2.0.0 1.5.1
build_cli_annotations ^1.0.0 1.1.0
shelf ^0.7.2 0.7.5
shelf_static ^0.2.0 0.2.8
Transitive dependencies
async 2.2.0
charcode 1.1.2
collection 1.14.11
convert 2.1.1
http_parser 3.1.3
meta 1.1.7
mime 0.9.6+2
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
Dev dependencies
build_cli ^1.0.0
build_runner ^1.0.0
build_verify ^1.0.0
path ^1.6.1 1.6.2
pedantic ^1.3.0
test ^1.3.0
test_process ^1.0.1