Add in /salvation

This commit is contained in:
nmemmert
2026-06-08 10:24:37 -04:00
parent 66699270f5
commit 95b7a3f211
3 changed files with 915 additions and 0 deletions
+10
View File
@@ -1,4 +1,5 @@
import express from 'express'
import path from 'node:path'
import { readFile } from 'node:fs/promises'
import { escapeHtml, escapeXml, injectSeoIntoHtml, normalizeSitemapPath } from '../helpers.js'
import {
@@ -15,6 +16,8 @@ import { DATA_FILE } from '../config.js'
import { sanitizeRedirectRules } from '../study-helpers.js'
export function register(app) {
const SALVATION_INDEX_FILE = path.join(DIST_DIR, 'salvation', 'index.html')
app.get('/robots.txt', async (_req, res) => {
let content = state.cachedSiteContent
if (!content) {
@@ -77,6 +80,13 @@ export function register(app) {
app.use('/images', express.static(PUBLIC_IMAGES_DIR))
app.use('/uploads', express.static(UPLOADS_DIR))
// Explicitly serve salvation page on both paths without relying on slash redirects.
app.get(['/salvation', '/salvation/'], (_req, res, next) => {
res.sendFile(SALVATION_INDEX_FILE, err => {
if (err) next()
})
})
// Social share stub for questions
app.get('/questions/share/:id', (req, res) => {
const id = req.params.id