dartnet 0.2.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 45

Dartnet

Configurable http server in dart.

  • [ ] For production server
  • [ ] For dev server (pub serve proxy)

Install

pub global activate dartnet

Usage

dartnet

or

pub run dartnet:dartnet

Commands

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

Configuration

Dartnet use a configuration file (default: 'dartnet.yaml')

Basic

address: "0.0.0.0"
port: 1337
root_directory: build

This will serve all file under the 'build' directory.

Complete

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"

Run example

cd example
dartnet

Changelog

0.2.0

  • Implement Path redirection
  • Config for redirections change, see example in README
  • Add dartnet dockerize command

0.1.2

  • update Jaguar ro 0.4.0

0.1.1

  • dartnet init command: create the default config file

0.1.0

  • Change configuration file, remove "server" key
  • Add gzip compression

0.0.2

  • Add SSL

0.0.1

  • Initial version, created by Stagehand

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dartnet: "^0.2.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 packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dartnet/dartnet.dart';
        
Version Uploaded Documentation Archive
0.2.0 Feb 24, 2017 Go to the documentation of dartnet 0.2.0 Download dartnet 0.2.0 archive
0.1.2 Feb 22, 2017 Go to the documentation of dartnet 0.1.2 Download dartnet 0.1.2 archive
0.1.1 Feb 22, 2017 Go to the documentation of dartnet 0.1.1 Download dartnet 0.1.1 archive
0.1.0 Feb 13, 2017 Go to the documentation of dartnet 0.1.0 Download dartnet 0.1.0 archive
0.0.2 Feb 11, 2017 Go to the documentation of dartnet 0.0.2 Download dartnet 0.0.2 archive
0.0.1+2 Feb 11, 2017 Go to the documentation of dartnet 0.0.1+2 Download dartnet 0.0.1+2 archive
0.0.1+1 Feb 11, 2017 Go to the documentation of dartnet 0.0.1+1 Download dartnet 0.0.1+1 archive
0.0.1 Feb 11, 2017 Go to the documentation of dartnet 0.0.1 Download dartnet 0.0.1 archive

Analysis

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

  • Dart: 2.0.0-dev.46.0
  • pana: 0.10.6

Scores

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

Platforms

Detected platforms: Flutter, other

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

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 3 errors.

    Strong-mode analysis of lib/src/handler.dart failed with the following error:

    line: 4 col: 8
    Target of URI doesn't exist: 'package:glob/glob.dart'.

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

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use dartnet.dart.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
ansicolor >=0.0.9 <0.1.0 0.0.9 0.1.0
jaguar >=0.4.0 <0.5.0 0.4.3 1.3.11
jaguar_mustache >=0.4.0 <0.5.0 0.4.0 0.5.0
resource >=2.0.0 <3.0.0 2.1.2
Transitive dependencies
args 0.13.7 1.4.1
charcode 1.1.1
collection 1.14.9
http_server 0.9.7
intl 0.14.0 0.15.4
logging 0.11.3+1
mime 0.9.6
mustache 0.2.5+1 1.0.0
path 1.5.1
quiver_hashcode 1.0.0
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
yaml 2.1.13
Dev dependencies
test >=0.12.0 <0.13.0