route_provider 0.1.11

  • Readme
  • Changelog
  • Installing
  • --

dart-routeprovider #

Installation #

Add it to your 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, {
            "url": "/",
            "controller": new RouteControllerEmpty(),
            "response": new FileResponse("docroot/index.html")
            "url": "/impress",
            "controller": new RouteControllerEmpty(),
            "response": new FileResponse("docroot/impress.html")
    }).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

License #


0.1.9 (2015-05-03) #


  • 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) #


  • add async/await handling

0.1.6 (2015-04-24) #


  • RouteControllers execute-methode gets the request as parameter


  • add await expressions and async methods

0.1.5 (2015-04-23) #


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

0.1.4 (2015-04-23) #


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


  • fix content root bug (@4stern)

Use this package as a library

1. Depend on it

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

  route_provider: ^0.1.11

2. Install it

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.

3. Import it

Now in your Dart code, you can use:

import 'package:route_provider/route_provider.dart';
Awaiting analysis to complete.