webart 0.2.0-alpha.6

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 69

web.dart

A lightweight web framework for Dart.

Unstable

This library is unstable now, it doesn't has any test. Any discussion welcome!

Features

  • Web server (Thanks shelf)
  • Plugin support
  • Router
  • Context support

Usage

This example show the basic usage of web.dart

  webart:
    git: https://gitlab.com/thislight/web.dart.git

Or

  webart: any

Code:

import "package:webart/web.dart";

main(){
    // Create app
    Application app = new Application(
        new Config(<String, dynamic>{
            "route":{
                "": helloWorldHandler,
            }
        })
    );

    // Start app
    app.start("127.0.0.1", 8088).then((_){
        print("Server started");
    });
}

// Define handler
Future helloWorldHandler(Request request) async{
    request.res.ok("Hello World");
}

Document

Now api documents aren't finished. But you can get a overview of this library.

Documents will be build when new changes pushing or everyday(4:00 UTC+8).

The document of branch master

The document of branch develop

LICENSE

Copyright 2017 thisLight

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

CHANGELOG

0.2.0-alpha.6

  • Remove LoggingLayer
  • Request.on changes to async

0.2.0-alpha.5

  • return not found when not handler found

0.2.0-alpha.4

  • Fix error that handler will be called twice

0.2.0-alpha.3

  • Fix error that handler not handled

0.2.0-alpha.2

  • Add EventBus for plugin
  • Redesign route system, allow using third party router
  • Redesign layer system, get Go away and make it powerful
  • A bit tests for EventBus

0.2.0-alpha.1

  • Fix performance problem while running handler, move waitForResponse to trash

0.1.0

  • First version

1. Depend on it

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


dependencies:
  webart: "^0.2.0-alpha.6"

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:webart/webart.dart';
        
Version Uploaded Documentation Archive
0.2.0-alpha.6 Feb 18, 2018 Go to the documentation of webart 0.2.0-alpha.6 Download webart 0.2.0-alpha.6 archive
0.2.0-alpha.5 Feb 5, 2018 Go to the documentation of webart 0.2.0-alpha.5 Download webart 0.2.0-alpha.5 archive
0.2.0-alpha.4 Feb 5, 2018 Go to the documentation of webart 0.2.0-alpha.4 Download webart 0.2.0-alpha.4 archive
0.2.0-alpha.3 Feb 5, 2018 Go to the documentation of webart 0.2.0-alpha.3 Download webart 0.2.0-alpha.3 archive
0.2.0-alpha.2 Feb 5, 2018 Go to the documentation of webart 0.2.0-alpha.2 Download webart 0.2.0-alpha.2 archive

Analysis

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

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

Scores

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

Platforms

Detected platforms: Flutter, other

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

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 4 errors 19 hints.

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

    line: 119 col: 32
    The function expression type '(Layer) → Future<dynamic>' isn't of type '(dynamic) → Future<dynamic>'. This means its parameter or return type does not match what is expected. Consider changing parameter type(s) or the returned type(s).

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

    line: 60 col: 22
    The argument type '(List<dynamic>) → Null' can't be assigned to the parameter type '(dynamic) → void'.

    Similar analysis of the following files failed:

    • lib/src/web.dart (error)
    • lib/src/config.dart (hint)
    • lib/src/context.dart (hint)
    • lib/src/handler.dart (hint)
    • lib/src/logging.dart (hint)
    • lib/src/plugin.dart (hint)
    • lib/src/request.dart (hint)
    • lib/web.dart (hint)
    • lib/webart.dart (hint)
  • Package is pre-release.

    Pre-release versions should be used with caution, their API may change in breaking ways.

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0
bwu_log ^0.1.2 0.1.2 2.0.0-alpha.2
logging ^0.11.3 0.11.3+1
shelf ^0.7.1 0.7.2
uri_template ^0.6.0 0.6.0
yaml ^2.1.12 2.1.13
Transitive dependencies
analyzer 0.27.6 0.31.1
args 0.13.7 1.4.2
async 2.0.6
charcode 1.1.1
collection 1.14.9
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
glob 1.1.5
html 0.13.3
http_parser 3.1.1
intl 0.12.7+1 0.15.6
isolate 0.2.3 2.0.0
matcher 0.12.2
meta 1.1.2
package_config 1.0.3
path 1.5.1
petitparser 1.7.6
plugin 0.2.0+2
quiver 0.29.0+1
source_span 1.4.0
stack_trace 1.9.2
stream_channel 1.6.5
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
Dev dependencies
test ^0.12.30