Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4051

In Next.js I'm getting a 404 error when I try to send a get request to a static route handler inside a dynamic one

$
0
0

I'm using thunder client and although the dynamic route is working fine, when I send a get request to the successor route it throws a 404 not found error, I know this means that the request can't reach the route.

The files hierarchy looks like this:

  • app/api/firebase/collection/[collectionName]/route.ts-app/api/firebase/collection/[collectionName]/customerProducts/route.ts

the request for the dynamic route works fine

the request for the successor static route doesn't work

this code is the same for both [collectionName] and products code

export async function GET() {  return NextResponse.json({ message: "done" });}

The code should fetch collections and products from the database but I've simplified it to that level to tackle the issue and still can't identify the problem. maybe is it prohibited in restAPI to put a static route inside a dynamic route I don't know...

I and appreciate any help, thanks in advance. :)


Viewing all articles
Browse latest Browse all 4051

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>