Merge pull request #73 from zigomir/fix-mailbox-example

Fix mailbox example
This commit is contained in:
Yoshua Wuyts
2016-06-30 16:15:06 +02:00
committed by GitHub
2 changed files with 6 additions and 4 deletions
+2 -1
View File
@@ -15,6 +15,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"css-wipe": "^4.2.1", "css-wipe": "^4.2.1",
"dateformat": "^1.0.12" "dateformat": "^1.0.12",
"tachyons": "^4.0.0-beta.33"
} }
} }
+4 -3
View File
@@ -11,14 +11,15 @@ server.listen(PORT, () => process.stdout.write(`listening on port ${PORT}\n`))
function createRouter () { function createRouter () {
const router = serverRouter('/404') const router = serverRouter('/404')
const js = bankai.js(browserify, require.resolve('./client.js'))
router.on('/bundle.js', (req, res) => js(req, res).pipe(res))
router.on('/:inbox/bundle.js', (req, res) => js(req, res).pipe(res))
const html = bankai.html({ css: false }) const html = bankai.html({ css: false })
router.on('/', (req, res) => html(req, res).pipe(res)) router.on('/', (req, res) => html(req, res).pipe(res))
router.on('/:inbox', (req, res) => html(req, res).pipe(res)) router.on('/:inbox', (req, res) => html(req, res).pipe(res))
router.on('/:inbox/:message_id', (req, res) => html(req, res).pipe(res)) router.on('/:inbox/:message_id', (req, res) => html(req, res).pipe(res))
const js = bankai.js(browserify, require.resolve('./client.js'))
router.on('/bundle.js', (req, res) => js(req, res).pipe(res))
router.on('/hi', (req, res) => res.end('{ "message": "hi back!" }')) router.on('/hi', (req, res) => res.end('{ "message": "hi back!" }'))
router.on('/404', (req, res) => { router.on('/404', (req, res) => {
res.statusCode = 404 res.statusCode = 404