choo: add server rendering
This commit is contained in:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user