Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

blink: redirect on root route (#8029)

* make root route redirect to 301

* use config

* end

* add a comment

authored by

Hailey and committed by
GitHub
0e658dbd d3c44ebc

+16
+2
bskylink/src/routes/index.ts
··· 4 4 import {default as createShortLink} from './createShortLink.js' 5 5 import {default as health} from './health.js' 6 6 import {default as redirect} from './redirect.js' 7 + import {default as root} from './root.js' 7 8 import {default as shortLink} from './shortLink.js' 8 9 import {default as siteAssociation} from './siteAssociation.js' 9 10 ··· 14 15 app = siteAssociation(ctx, app) // GET /.well-known/apple-app-site-association 15 16 app = redirect(ctx, app) // GET /redirect 16 17 app = createShortLink(ctx, app) // POST /link 18 + app = root(ctx, app) // GET / (redirect to bsky.app on root) 17 19 app = shortLink(ctx, app) // GET /:linkId (should go last due to permissive matching) 18 20 return app 19 21 }
+14
bskylink/src/routes/root.ts
··· 1 + import {Express} from 'express' 2 + 3 + import {AppContext} from '../context.js' 4 + import {handler} from './util.js' 5 + 6 + export default function (ctx: AppContext, app: Express) { 7 + return app.get( 8 + '/', 9 + handler(async (_req, res) => { 10 + res.setHeader('Location', `https://${ctx.cfg.service.appHostname}`) 11 + return res.status(301).end() 12 + }), 13 + ) 14 + }