Skip to content

Instantly share code, notes, and snippets.

Created Sep 18, 2016
What would you like to do?
var choo = require('choo')
var html = require('choo/html')
var app = choo()
app.router(function (route) {
return [
route('/', home)
route('/:page', page)
function home (state, prev, send) {
return html`<h1>home</h1>`
function page (state, prev, send) {
var pagename =
// can also access state.location.pathname which mirrors window.location.pathname
return html`<h1>${pagename}</h1>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment