website/src/routes/+layout.server.ts

18 lines
504 B
TypeScript
Raw Normal View History

import { incrementVisitCount, notifyDarkVisitors } from '$lib/visits.js';
2024-10-01 02:44:39 +03:00
export const csr = true;
export const ssr = true;
2024-10-01 19:22:15 +03:00
export const prerender = false;
2024-10-01 02:44:39 +03:00
export const trailingSlash = 'always';
export async function load({ request, cookies, url, setHeaders, fetch }) {
notifyDarkVisitors(url, request) // no await so it doesnt block load
setHeaders({ 'Cache-Control': 'no-cache' })
2024-10-04 03:13:11 +03:00
return {
route: url.pathname,
visitCount: incrementVisitCount(request, cookies),
2024-10-01 02:44:39 +03:00
}
}