about summary refs log tree commit diff
path: root/bskylink/src/routes/root.ts
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2025-03-20 14:50:15 -0700
committerGitHub <noreply@github.com>2025-03-20 14:50:15 -0700
commit0e658dbdfdd4e6ece53ee04caf93d596034be587 (patch)
tree12b5230f758c4cbf4313cfbef90721308ad109c3 /bskylink/src/routes/root.ts
parentd3c44ebc5b9becc78b58a4f12f9bbf7173da9e32 (diff)
downloadvoidsky-0e658dbdfdd4e6ece53ee04caf93d596034be587.tar.zst
blink: redirect on root route (#8029)
* make root route redirect to 301

* use config

* end

* add a comment
Diffstat (limited to 'bskylink/src/routes/root.ts')
-rw-r--r--bskylink/src/routes/root.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/bskylink/src/routes/root.ts b/bskylink/src/routes/root.ts
new file mode 100644
index 000000000..12bdf1515
--- /dev/null
+++ b/bskylink/src/routes/root.ts
@@ -0,0 +1,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()
+    }),
+  )
+}