Files
buuh/examples/http/views/main.js
T

15 lines
394 B
JavaScript
Raw Normal View History

2016-06-30 08:18:07 -07:00
const html = require('../../../html')
2016-05-13 12:24:51 +07:00
2016-07-02 00:13:13 +02:00
module.exports = function (state, prev, send) {
2016-06-27 01:04:21 +02:00
const error = state.app.errors[0]
2016-05-23 10:44:32 +09:00
const title = state.api.title
2016-06-30 08:18:07 -07:00
return html`
2016-05-13 12:24:51 +07:00
<section>
2016-05-23 10:44:32 +09:00
<h1>${title}</h1>
<h2>Latest error: ${error}</h2>
2016-05-13 12:24:51 +07:00
<button onclick=${(e) => send('api:good')}>OK!</button>
<button onclick=${(e) => send('api:bad')}>Naughty</button>
</section>
`
}