mahiro mahiro mahiro
Explore posts from serversWays to have local middleware inside server/
import { getServerSession } from "#auth";
import Cart from "~/server/models/cart.schema";
import mongoose from "mongoose";
const appConfig = useAppConfig();
export default defineEventHandler(async (event) => {
const session = await getServerSession(event);
if (!session) {
throw createError(appConfig.error.unauthorized);
}
currently this is my setup
7 replies
Ways to have local middleware inside server/
https://nuxt.com/docs/guide/directory-structure/server#server-utilities
is this what you mean?
7 replies