Error using API Routes
Answered
Basset Bleu de Gascogne posted this in #help-forum
Basset Bleu de GascogneOP
import { NextRequest, NextResponse } from "next/server";
export function Get(request:NextRequest){
console.log("Get", request);
return NextResponse.json({
"message":"Verified"
});
} this is the code and the error is No HTTP methods exported in 'C:\Users\kaush\findmedev\findmedev\src\app\api\user\login\route.ts'. Export a named export for each HTTP method.6 Replies
@Basset Bleu de Gascogne js
import { NextRequest, NextResponse } from "next/server";
export function Get(request:NextRequest){
console.log("Get", request);
return NextResponse.json({
"message":"Verified"
});
} this is the code and the error is No HTTP methods exported in 'C:\Users\kaush\findmedev\findmedev\src\app\api\user\login\route.ts'. Export a named export for each HTTP method.
You can see, that your get looks like „Get“. Normally it should look like „GET“ to make it working ðŸ‘
@B33fb0n3 You can see, that your get looks like „Get“. Normally it should look like „GET“ to make it working ðŸ‘
@Basset Bleu de Gascogne worked?
@Ray it should be `GET`, all uppercase
Basset Bleu de GascogneOP
Thanks worked
@B33fb0n3 <@426939679338659840> worked?
Basset Bleu de GascogneOP
Yes thanks alot
Sorry for the late response