Monorepo for wisp.place. A static site hosting service built on top of the AT Protocol. wisp.place

marketing page on /home

+17
+17
apps/main-app/src/index.ts
··· 216 216 const html = await Bun.file('./apps/main-app/public/landingpage.html').text() 217 217 return html.replaceAll('{{ATPROTO_LOGIN_URL}}', atprotoLoginUrl) 218 218 }) 219 + .get('/home', async ({ request, set }) => { 220 + // Same as / but without the auto-redirect script for signed-in users 221 + const loginUrl = isLocalDev 222 + ? `${new URL(request.url).origin}/api/auth/login` 223 + : `${config.domain}/api/auth/login` 224 + const atprotoLoginUrl = `https://atproto.wisp.place/?next=${encodeURIComponent(loginUrl)}` 225 + 226 + set.headers['Content-Type'] = 'text/html; charset=utf-8' 227 + 228 + const html = await Bun.file('./apps/main-app/public/landingpage.html').text() 229 + return html 230 + .replaceAll('{{ATPROTO_LOGIN_URL}}', atprotoLoginUrl) 231 + .replace( 232 + /<script>\s*\/\/ Check if user is already signed in[\s\S]*?<\/script>/, 233 + '' 234 + ) 235 + }) 219 236 .use(authRoutes(client, cookieSecret)) 220 237 .use(wispRoutes(client, cookieSecret)) 221 238 .use(domainRoutes(client, cookieSecret))