skip to Main Content

Mongodb – Import Mongoose lib in api directory in Next js 13.2 app directory gives error

In hello.js import connectMongo from '../../../util/connectDB'; import UserModel from '../../../models/UserModel'; import { NextResponse } from 'next/server' export async function GET(request) { return NextResponse.json({hello: 'Hello, Next.js!'}) } export async function POST(request) { const data = await request.json(); console.log(data); return NextResponse.json(data) }…

VIEW QUESTION

Laravel / NextJS CORS Issue

I have been connecting my Laravel API backend to my NextJS frontend. Everything worked well until I put part of my NextJS app onto a subdomain and I immediately got CORS errors. "Access to XMLHttpRequest at 'http://myapp.test:8080/dashboard' (redirected from 'http://myapp.test:8080/api/login')…

VIEW QUESTION
Back To Top
Search