about summary refs log tree commit diff
path: root/bskylink/src/routes/root.ts
blob: 12bdf15155fba2a934f8972b85720ddd1ec95df9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import {Express} from 'express'

import {AppContext} from '../context.js'
import {handler} from './util.js'

export default function (ctx: AppContext, app: Express) {
  return app.get(
    '/',
    handler(async (_req, res) => {
      res.setHeader('Location', `https://${ctx.cfg.service.appHostname}`)
      return res.status(301).end()
    }),
  )
}