feat: render announcements on dashboard
Some checks failed
Node.js CI / Lint and Test (pull_request) Failing after 53s

This commit is contained in:
2025-07-05 19:09:05 -07:00
parent 4ca9042bcd
commit 9842f49fec
14 changed files with 1372 additions and 8 deletions

View File

@ -4,6 +4,7 @@
* @author Naomi Carrigan
*/
import cors from "@fastify/cors";
import fastify from "fastify";
import { corsHook } from "./hooks/cors.js";
import { ipHook } from "./hooks/ips.js";
@ -15,6 +16,17 @@ const server = fastify({
logger: false,
});
/**
* This needs to be first, to ensure all requests have CORS configured.
* Our CORS settings allow for any origin, because we have a custom hook
* that guards specific routes from CORS requests.
* This is to allow our uptime monitor to access the health check route, for example.
* @see routesWithoutCors.ts
*/
server.register(cors, {
origin: "*",
});
server.addHook("preHandler", corsHook);
server.addHook("preHandler", ipHook);