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
--port- Set the port. Defaults to 8080.
--path- Set the path to serve. Defaults to cwd.
--host- Hostname to listen on. Defaults to localhost.
allow-origin flag. In reality, this flag never worked because the
shelf pipeline was not configured correctly.
Source moved to github.com/kevmoo/dhttpd.
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.
Add this to your package's pubspec.yaml file:
dependencies: dhttpd: "^2.0.0"
You can install packages from the command line:
$ pub get
$ flutter packages get
Alternatively, your editor might support
pub get or
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
|2.0.0||Mar 5, 2018|
|0.3.1||Sep 20, 2015|
We analyzed this package on Mar 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
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]
Detected platforms: Flutter, other
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:
example.dartor you could also use
|Dart SDK||>=1.8.0 <2.0.0|