jorishermans / shelf_mvc

An mvc implementation, to render pages with shelf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

An mvc implementation, to render pages with shelf

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:CSS 77.5%Language:Dart 21.7%Language:HTML 0.8%