shelf_mvc 0.0.3 copy "shelf_mvc: ^0.0.3" to clipboard
shelf_mvc: ^0.0.3 copied to clipboard

Dart 1 only

An shelf package to render pages according the mvc principles.

shelf mvc #

This dart library helps you with managing model view control principle into shelf. By default the template engine is mustache.

Usage #

A simple usage example:

MonoRoute r = new MonoRoute();

r.get('/', (Model model, RequestData rqData) {
  model.addAttribute('hello', 'world');
  return 'home';
});

// stack up handlers
var handler = new Cascade()
    .add(createMVCHandler('client/build/web/',
         monoRoute))
    .handler;

// start shelf
io.serve(handler, 'localhost', 6060).then((server) {
   print('Serving at http://${server.address.host}:${server.port}');
});

Contribution #

If you'd like to contribute back to the core, you can fork this repository and send us a pull request, when it is ready.

If you are new to Git or GitHub, please read this guide first.

Todo #

  • Isomorphic approach
  • Using pub serve for the templates
  • extending the examples
  • usage of annotations
0
likes
25
points
5
downloads

Publisher

unverified uploader

Weekly Downloads

An shelf package to render pages according the mvc principles.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

http_server, logging, mustache, shelf, uri

More

Packages that depend on shelf_mvc