Routify 3 public BETA is here! Check it out

Express example

1. install express and ssr

npm i express tossr

2. Create server.js

const express = require('express')
const app = express()

const PORT = 5000
const TEMPLATE = 'dist/__app.html'

// serve assets, if they exist
app.use(express.static('dist'))

// otherwise serve Routify
app.get('*', async (req, res) => {
  res.sendFile(TEMPLATE, { root: __dirname })
})

// start server
app.listen(PORT)
console.log('serving on port', PORT)

3. Run server

node server


Writing good documentation that is up-to-date is difficult. If you notice a mistake, help us out.