Skip to content

Instantly share code, notes, and snippets.

@hunterloftis
Created February 17, 2014 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hunterloftis/9058114 to your computer and use it in GitHub Desktop.
Save hunterloftis/9058114 to your computer and use it in GitHub Desktop.
//require('./jsx-modules'); // Enable JSX transforms for require
var defer = require('q').defer;
//var react = require('react-tools');
function *page() {
this.body = yield render({
route: this.path
});
}
module.exports = page;
function render(viewModel) {
var d = defer();
//var template = require('./view/test.jsx');
//var html = react.renderComponentToString()
d.resolve('test');
return d;
}
@hunterloftis
Copy link
Author

Server:

var server = koa();

  server
    //.use(mount('/api', api))
    .use(page);

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