diff --git a/bun.lock b/bun.lock index 7c62e8d..2848d4d 100644 --- a/bun.lock +++ b/bun.lock @@ -5,11 +5,14 @@ "": { "name": "moshcode.sh", "dependencies": { + "@profullstack/footer": "latest", "express": "5.1.0", }, }, }, "packages": { + "@profullstack/footer": ["@profullstack/footer@0.2.1", "", { "peerDependencies": { "react": ">=18" }, "optionalPeers": ["react"], "bin": { "profullstack-footer": "bin/profullstack-footer.js" } }, "sha512-KHmKVwrlzCBrSAAJ4zobNFCxTg8VF0gvNMeAut00dX3+gbWCtk6eOwIR2AaqEC7smj6Aio6cIexzt/dUnv1McA=="], + "accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], "body-parser": ["body-parser@2.3.0", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^2.0.0", "debug": "^4.4.3", "http-errors": "^2.0.1", "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", "qs": "^6.15.2", "raw-body": "^3.0.2", "type-is": "^2.1.0" } }, "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw=="], diff --git a/package.json b/package.json index e915405..5f220ff 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "check": "bun scripts/sync-commands.mjs --check" }, "dependencies": { + "@profullstack/footer": "latest", "express": "5.1.0" }, "packageManager": "bun@1.4.0" diff --git a/src/server.mjs b/src/server.mjs index b836492..2d93617 100644 --- a/src/server.mjs +++ b/src/server.mjs @@ -1,4 +1,6 @@ import express from 'express'; +import { randomBytes } from 'node:crypto'; +import { footerHtml } from '@profullstack/footer'; import { readFileSync } from 'node:fs'; import { resolve, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; @@ -31,12 +33,14 @@ export function createApp() { app.set('etag', 'strong'); app.use((_req, res, next) => { + // Per-response nonce for the one inline