Configurable http server in dart.
pub serve
proxy)pub global activate dartnet
dartnet
or
pub run dartnet:dartnet
Usage 'dartnet' :
-c, --config (defaults to "dartnet.yaml")
-h, --help
COMMANDS:
init Create config file with default value.
-f, --filename (defaults to "dartnet.yaml")
dockerize Create a Dockerfile from the Dartnet config file
-f, --filename (defaults to "dartnet.yaml")
Dartnet use a configuration file (default: 'dartnet.yaml')
address: "0.0.0.0"
port: 1337
root_directory: build
This will serve all file under the 'build' directory.
address: "0.0.0.0" #default: 0.0.0.0
port: 1337 #default: 8080
root_directory: web #default: build
multithread: true #default: true
log: info #default: info
log_file: "dartnet.log" #default: dartnet.log
list_directory: false #default: false
gzip: true #default: true
redirections:
path:
/: "index.html" #default behavior
/redirect: "https://www.google.com"
/**: "index.html"
404: error.html
https:
cert: ssl/cert.pem
key: ssl/key.pem
password_key: "dartnet"
cd example
dartnet
dartnet dockerize
commanddartnet init
command: create the default config fileYou can install the package from the command line:
$ pub global activate dartnet
The package has the following executables:
$ dartnet
Add this to your package's pubspec.yaml file:
dependencies:
dartnet: ^0.3.0
You can install packages from the command line:
with pub:
$ pub get
Alternatively, your editor might support pub get
.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:dartnet/dartnet.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.3.0 | Dec 4, 2018 |
|
|
0.2.0 | Feb 24, 2017 |
|
|
0.1.2 | Feb 22, 2017 |
|
|
0.1.1 | Feb 22, 2017 |
|
|
0.1.0 | Feb 13, 2017 |
|
|
0.0.2 | Feb 11, 2017 |
|
|
0.0.1+2 | Feb 11, 2017 |
|
|
0.0.1+1 | Feb 11, 2017 |
|
|
0.0.1 | Feb 11, 2017 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
0
|
Health:
Code health derived from static analysis.
[more]
|
91
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
80
|
Overall:
Weighted score of the above.
[more]
|
43
|
We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: other
Primary library:
package:dartnet/dartnet.dart
with components:io
,isolate
,mirrors
.
Document public APIs. (-1 points)
51 out of 51 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.
Fix lib/src/utils.dart
. (-5.84 points)
Analysis of lib/src/utils.dart
reported 12 hints, including:
line 126 col 37: 'HOST' is deprecated and shouldn't be used.
line 130 col 37: 'VIA' is deprecated and shouldn't be used.
line 153 col 36: 'VIA' is deprecated and shouldn't be used.
line 157 col 42: 'TRANSFER_ENCODING' is deprecated and shouldn't be used.
line 161 col 44: 'CONTENT_ENCODING' is deprecated and shouldn't be used.
Fix lib/src/server.dart
. (-1.49 points)
Analysis of lib/src/server.dart
reported 3 hints:
line 9 col 38: Use =
to separate a named parameter from its default value.
line 43 col 37: Use =
to separate a named parameter from its default value.
line 54 col 32: Use =
to separate a named parameter from its default value.
Fix lib/src/config.dart
. (-0.50 points)
Analysis of lib/src/config.dart
reported 1 hint:
line 37 col 46: Use =
to separate a named parameter from its default value.
Fix lib/src/logger.dart
. (-0.50 points)
Analysis of lib/src/logger.dart
reported 1 hint:
line 18 col 55: 'APPEND' is deprecated and shouldn't be used.
The package description is too short. (-20 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.
Maintain an example.
None of the files in the package's example/
directory matches known example patterns.
Common filename patterns include main.dart
, example.dart
, and dartnet.dart
. Packages with multiple examples should provide example/README.md
.
For more information see the pub package layout conventions.
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=2.0.0 <3.0.0 | ||
ansicolor | ^1.0.2 | 1.0.2 | |
args | ^1.5.1 | 1.5.1 | |
jaguar | ^2.4.0 | 2.4.26 | |
logging | ^0.11.3+2 | 0.11.3+2 | |
mustache | ^1.0.2 | 1.1.1 | |
path | ^1.6.2 | 1.6.2 | |
resource | ^2.1.5 | 2.1.5 | |
yaml | ^2.1.15 | 2.1.15 | |
Transitive dependencies | |||
auth_header | 2.1.2 | ||
charcode | 1.1.2 | ||
collection | 1.14.11 | ||
convert | 2.1.1 | ||
crypto | 2.0.6 | ||
http_server | 0.9.8+1 | ||
jaguar_common | 2.1.4 | ||
jaguar_serializer | 2.2.8 | ||
meta | 1.1.7 | ||
mime | 0.9.6+2 | ||
path_tree | 2.2.2 | ||
source_span | 1.5.4 | ||
stack_trace | 1.9.3 | ||
string_scanner | 1.0.4 | ||
term_glyph | 1.1.0 | ||
typed_data | 1.1.6 | ||
Dev dependencies | |||
test | ^1.3.0 |