dhttpd 2.0.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 55

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

  • --port - Set the port. Defaults to 8080.
  • --path - Set the path to serve. Defaults to cwd.
  • --host - Hostname to listen on. Defaults to localhost.

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: "^2.0.0"

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
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

Analysis

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

  • Dart: 2.0.0-dev.54.0
  • pana: 0.11.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
9 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
55
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

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

Suggestions

  • The description is too short.

    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.

    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 >=1.8.0 <2.0.0
args >=0.12.0+1 <2.0.0 1.4.3
shelf ^0.7.2 0.7.3
shelf_static ^0.2.0 0.2.7
Transitive dependencies
async 2.0.7
charcode 1.1.1
collection 1.14.9
convert 2.0.1
http_parser 3.1.2
mime 0.9.6+1
path 1.5.1
source_span 1.4.0
stack_trace 1.9.2
stream_channel 1.6.6
string_scanner 1.0.2
typed_data 1.1.5