Add this line to the bottom of your code:
require('stack-page')(stack)
Your links and stack routes must be prefixed with a backsash "/"
ie, this link: go
with this stack listener: stack.on('/do-something', go)
will run the go function.
This is a good pattern, should formalize around this:
You have a URL ie: '/slog/entry'
on that page you have links you want to do stack fires; but differntiate them so you know they aren't URLs that will be clicked.
So you should prefix them with a hash ie- href="#save"
Then make a stack route to listen for '/slog/entry#save'
TODO: if you don't use a hash link stack-page will process the link as if it was a native link.
TODO: make a test for this
For developing on the test file, do:
watchify test/index.js -o test/bundle.js --debug -v