Redstone.dart

A server-side microframework for the Dart platform

Simple and intuitive
Redstone.dart allows you to easily publish your functions and classes through a web interface, by just adding some annotations to them.
import 'package:redstone/server.dart' as app;

@app.Route("/")
helloWorld() => "Hello, World!";

main() {
  app.setupConsoleLog();
  app.start();
}
Powerful
Includes support for request interceptors, error handlers, dependency injection and many other features.
@app.Interceptor(r'/admin/.*')
adminFilter() {
  if (app.request.session["username"] != null) {
    app.chain.next();
  } else {
    app.chain.interrupt(statusCode: HttpStatus.UNAUTHORIZED);
    //or app.redirect("/login.html");
  }
}
@app.ErrorHandler(404)
handleNotFoundError() => app.redirect("/error/not_found.html");
Easily testable
Easily test your server, without the need of an external tool.
main() {

  setUp(app.setUp);

  tearDown(app.tearDown);

  test("service", () {
    var req = new MockRequest("/service");
    return app.dispatch(req).then((resp) {
      expect(resp.statusCode, equals(200));
      expect(resp.mockContent, equals("ok"));
    });
  })

}