choo: add server rendering

This commit is contained in:
Yoshua Wuyts
2016-05-22 02:06:46 +09:00
parent ffca94d59a
commit 4084775c8c
6 changed files with 150 additions and 5 deletions
+16
View File
@@ -0,0 +1,16 @@
const choo = require('../../')
const mainView = require('./views/main')
const app = choo()
app.router((route) => [
route('/', mainView)
])
if (module.parent) {
module.exports = app
} else {
const tree = app.start()
document.body.appendChild(tree)
}