Guides › Routes › Handlers ← PREV NEXT →
A handler can live in its own file.
// app/pages/home.js
module.exports = {
paths: '/',
handler: 'home'
}
// app/handlers/home.js
module.exports = function (state) {
return '<h1>Hello world!</h1>'
}
Handler names resolve beneath app/handlers. Nested names such as account/show work too.
Next: Catchall →