generated from nhcarrigan/template
feat: render announcements on dashboard
Some checks failed
Node.js CI / Lint and Test (pull_request) Failing after 53s
Some checks failed
Node.js CI / Lint and Test (pull_request) Failing after 53s
This commit is contained in:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user