Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
275 views

Writing a dynamic api route for page that accepts [slug] params. export async function GET(request: NextRequest, { params }: { params: Promise<{ slug: string}> }) { const {slug} = await ...
VsiON4ALL's user avatar
0 votes
0 answers
62 views

I am working on an API in Next.js 14+ where I need to upload files. Here are the fields I am using: name: string description: string profile_picture: single image documents: multiple files images: ...
Kaustubh Trivedi's user avatar
0 votes
0 answers
100 views

I'm encountering an issue with a Next.js API route. I'm making a POST request to the /api/message endpoint, but it returns a 404 Not Found error. Here’s the context: File Structure: The API route is ...
MadMax's user avatar
  • 1
1 vote
1 answer
2k views

I'm trying to access a request's User-Agent header from a route handler I have on my next.js project. Here is an example: import { userAgent } from "next/server"; export const dynamic = &...
tallphin's user avatar
0 votes
0 answers
120 views

My backend with NextJS export async function DELETE( req: Request, { params }: { params: { productId: string } } ) { try { const storeId = '665a238f72ab3f9616e1a1d8'; const product = ...
Being47's user avatar
  • 101
1 vote
1 answer
4k views

I am trying to send a blob (will be a file from another API in future) as the response for a api call in next13 api routes. My handler goes like: export default async function handler(req, res) { ...
Anandu Babu's user avatar
0 votes
2 answers
474 views

This API calculates the BMI and sends it to the frontend. I have tried console logging the response, but it does not have the BMI in it. I assume this is because of some unsynchronous behaviour. This ...
Harsh Singh's user avatar
1 vote
1 answer
2k views

I was using Route Handler for fetching from external endpoint. The external endpoint is returning status 400 or any error, but when I locally hit API from the client component (e.g /api/route.ts) I ...
Muhammad Tohir Rafly's user avatar
0 votes
1 answer
845 views

Every API in the NextJS project is giving a 504 bad gateway time out error only in vercel production deployment, everything works fine in local, so I added a hello GET API with the sample code. export ...
Aflah Najeeb's user avatar
1 vote
5 answers
11k views

I'm currently working on a project using Next.js 14 and I'm facing challenges integrating Socket.io with the /api routes. I've explored various resources but haven't found a clear and concise guide on ...
homi420's user avatar
  • 11
0 votes
0 answers
134 views

The GET and POST handle functions are written in the api/nav/route.ts file at the same time. The development environment is normal. However, after deployment through vercel, the GET request returns an ...
linzhe141's user avatar
0 votes
1 answer
3k views

Objective: What I am trying to achieve: With a button click from a page the req will reach the controller. The controller will set some cookie, when the response will redirect the page to another ...
Kishore Kumer's user avatar