diff --git a/nuxt.config.ts b/nuxt.config.ts index 8084fa9..544c7d6 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,6 +1,5 @@ // https://nuxt.com/docs/api/configuration/nuxt-config import { IUser } from "~/models/user"; -import { defineNuxtModule } from "@nuxt/kit"; // import speedkitHydrate from "nuxt-speedkit/dist/runtime/hydrate.mjs"; export type SessionData = IUser; @@ -10,7 +9,7 @@ const cac = { cache: { headersOnly: true, // integrity: "", - // varies: ["Content-Length"], + varies: ["Content-Length", "Cookie"], maxAge: 60, }, swr: false, @@ -33,6 +32,7 @@ export default defineNuxtConfig({ "@pinia/nuxt", "@vueuse/nuxt", "nuxt-speedkit", + // "./modules/09.loaded", ], speedkit: { disableNuxtFontaine: true, @@ -56,7 +56,7 @@ export default defineNuxtConfig({ maxAgeInSeconds: 14 * 24 * 60 * 60, // sameSiteAttribute: , }, - sessionDataType: {} as { [Property in keyof IUser]: string }, + sessionDataType: {} as IUser, endpoints: { signUp: { path: "/register", method: "post" }, signOut: { path: "/logout", method: "post" }, @@ -81,18 +81,20 @@ export default defineNuxtConfig({ sourceMap: "inline", }, }, - preset: "node", + preset: "node-server", }, routeRules: { "/": cac, "/api/**": { cors: true }, - "/bands/**": cac, + "/band/**": cac, "/authors": cac, "/story/**": { swr: true, isr: true, cache: { maxAge: 1800, + headersOnly: true, + varies: ["Cookie", "Set-Cookie"], }, }, // "/authors": { swr: 0 },