1 | var html = require('choo/html')
|
2 | var css = require('sheetify')
|
3 | var choo = require('choo')
|
4 |
|
5 | css('tachyons')
|
6 |
|
7 | var app = choo()
|
8 |
|
9 | if (process.env.NODE_ENV === 'production') {
|
10 | app.use(require('choo-service-worker')())
|
11 | } else {
|
12 | app.use(require('choo-devtools')())
|
13 | }
|
14 |
|
15 | app.route('/', function (state, emit) {
|
16 | emit('DOMTitleChange', 'hello planet')
|
17 | return html`
|
18 | <body class="sans-serif">
|
19 | Hello planet
|
20 | </body>
|
21 | `
|
22 | })
|
23 |
|
24 | app.route('/other', function (state, emit) {
|
25 | emit('DOMTitleChange', 'hello planet')
|
26 | return html`
|
27 | <body class="sans-serif">
|
28 | Hello other
|
29 | </body>
|
30 | `
|
31 | })
|
32 |
|
33 | module.exports = app.mount('body')
|