route_provider 0.3.5

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 30

dart-routeprovider

Join the chat at https://gitter.im/4stern/dart-routeprovider Build Status Stories in Ready

Installation

Add it to your dependencies

dependencies:
  route_provider: any

and install the package

$ pub get

Usage

import 'dart:io';
import 'package:route_provider/route_provider.dart';
main() {
    HttpServer.bind(InternetAddress.LOOPBACK_IP_V4,8080).then((HttpServer server){
        new RouteProvider(server, {
            "defaultRoute":"/",
            "staticContentRoot":"/docroot"
        })
        ..route(
            url: "/",
            controller: new EmptyRouteController(),
            responser: new FileResponse("docroot/index.html"),
            auth: new StaticAuth(authed: true)
        )
        ..route(
            url: "/impress",
            controller: new RestApiController(),
            responser: new FileResponse("docroot/impress.html"),
            auth: new StaticAuth(authed: true)
        )
        ..start();
    }).catchError((e) => print(e.toString()));
}

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Credits

Robert Beyer 4sternrb@googlemail.com

License

MIT

0.3.5 (2016-05-13)

  • add NoneResponse responsehandler

0.3.4 (2015-10-21)

  • add AuthResponse to ApiRestController

0.3.3 (2015-10-16)

  • change auth signature and handling

0.3.2 (2015-10-16)

  • update tests

0.3.1 (2015-10-16)

  • parsing http-request and params to auth handler

0.3.0 (2015-10-16)

  • add the optional named parameter 'auth' (interface Auth) to the route method for authentication possibilities. it checks before the controller and responsehandler do there work if the call is authenticated - default is true.

0.2.0 (2015-08-27)

  • rename RouteControllerEmpty to EmptyRouteController
  • add JsonResponser
  • add ApiRestController
  • change method signature of .route by using named parameters instead of map

0.1.13

  • Adding helfer functions to route-controller for parsing body-data like post-values

0.1.9 (2015-05-03)

Feature:

  • add RouteError for transporting http-status-codes and messages to this layer; to handle error output not for your own

0.1.7 (2015-05-03)

Feature:

  • add async/await handling

0.1.6 (2015-04-24)

Feature:

  • RouteControllers execute-methode gets the request as parameter

Test:

  • add await expressions and async methods

0.1.5 (2015-04-23)

Feature:

  • FileResponseHandler now sends file content as stream to response (@4stern)

0.1.4 (2015-04-23)

Tests:

  • adding testfile to test the provider (@4stern)

Bugfixes:

  • fix content root bug (@4stern)

1. Depend on it

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


dependencies:
  route_provider: "^0.3.5"

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:route_provider/route_provider.dart';
        
Version Uploaded Documentation Archive
1.0.1 Jan 14, 2018 Go to the documentation of route_provider 1.0.1 Download route_provider 1.0.1 archive
1.0.0 Jan 14, 2018 Go to the documentation of route_provider 1.0.0 Download route_provider 1.0.0 archive
0.3.6 May 13, 2016 Go to the documentation of route_provider 0.3.6 Download route_provider 0.3.6 archive
0.3.5 May 13, 2016 Go to the documentation of route_provider 0.3.5 Download route_provider 0.3.5 archive
0.3.4 Oct 21, 2015 Go to the documentation of route_provider 0.3.4 Download route_provider 0.3.4 archive
0.3.3 Oct 16, 2015 Go to the documentation of route_provider 0.3.3 Download route_provider 0.3.3 archive
0.3.2 Oct 16, 2015 Go to the documentation of route_provider 0.3.2 Download route_provider 0.3.2 archive
0.3.1 Oct 16, 2015 Go to the documentation of route_provider 0.3.1 Download route_provider 0.3.1 archive
0.3.0 Oct 16, 2015 Go to the documentation of route_provider 0.3.0 Download route_provider 0.3.0 archive
0.2.0 Aug 27, 2015 Go to the documentation of route_provider 0.2.0 Download route_provider 0.2.0 archive

All 24 versions...

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]
93 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
8 / 100
Overall score:
Weighted score of the above. [more]
30
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:route_provider/route_provider.dart with components: io.

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 error 12 hints.

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

    line: 35 col: 27
    A value of type 'Iterable<List<String>>' can't be assigned to a variable of type 'List'.

    Run dartfmt to format lib/route_provider.dart.

    Similar analysis of the following files failed:

    • lib/src/auth/AuthInterface.dart (hint)
    • lib/src/controllers/RestApiController.dart (hint)
    • lib/src/errors/route_error.dart (hint)
    • lib/src/response_handler.dart (hint)
    • lib/src/responsehandlers/JsonResponse.dart (hint)
    • lib/src/responsehandlers/NoneResponse.dart (hint)
    • lib/src/responsehandlers/file_response.dart (hint)
  • 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.

    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 route_provider.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
mime_type >=0.1.7 <0.2.0 0.1.8 0.2.1