dhttpd 3.0.1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 49

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]
16
Health:
Code health derived from static analysis. [more]
90
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
49
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, other

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

Health issues and suggestions

Document public APIs (-10 points)

8 out of 8 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dhttpd.dart.

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.0.1
shelf ^0.7.2 0.7.3+3
shelf_static ^0.2.0 0.2.8
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
convert 2.0.2
http_parser 3.1.3
meta 1.1.6
mime 0.9.6+2
source_span 1.4.1
stack_trace 1.9.3
stream_channel 1.6.8
string_scanner 1.0.4
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