Skip to content

Instantly share code, notes, and snippets.

@artjumble
Created April 18, 2012 17:01
Show Gist options
  • Save artjumble/2415038 to your computer and use it in GitHub Desktop.
Save artjumble/2415038 to your computer and use it in GitHub Desktop.
Simplistic derby
var app = require('derby').createApp(module)
, get = app.get
, view = app.view
, ready = app.ready
// ROUTES //
// Derby routes can be rendered on the client and the server
get('/', function(page, model, params) {
page.render()
})
// CONTROLLER FUNCTIONS //
ready(function(model) {
exports.reload = function() {
window.location.reload()
}
})
<Title:>
visits
<Body:>
<h1>sdf</h1>
@timc3
Copy link

timc3 commented Apr 18, 2012

This it might be like this

  get('/', function(page, model) {
    return model.subscribe('message', function() {
      return page.render();
    }); 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment