/** @type {import('@sveltejs/kit').Handle} */
export async function handle({ event, resolve }) {
	if (event.url.pathname !== "/maintenance" && process.env.MAINTENANCE == "true" && process.env.PRODUCTION == "true") {
		return new Response("", { status: 302, headers: { Location: "/maintenance" } });
	}

	return await resolve(event);
}
