examples/http: update for ns

This commit is contained in:
Yoshua Wuyts
2016-05-23 13:44:32 +09:00
parent 300b6325a9
commit 0cc0caa8e1
5 changed files with 89 additions and 76 deletions
+4 -2
View File
@@ -1,10 +1,12 @@
const choo = require('../../../')
module.exports = function (params, state, send) {
const error = state.app.error[0]
const title = state.api.title
return choo.view`
<section>
<h1>${state['api:title']}</h1>
<h2>Latest error: ${state.error[0]}</h2>
<h1>${title}</h1>
<h2>Latest error: ${error}</h2>
<button onclick=${(e) => send('api:good')}>OK!</button>
<button onclick=${(e) => send('api:bad')}>Naughty</button>
</section>