What is api route in next js? Before we use api route, you should know next js. What is api route in 14 and how is it used? Next js is a full stack framework, you can use it for both frontend and backend. Using next js we can create full stack projects like We can create it which makes our work easier. Ever since Next JS came, it is being liked a lot.
const { NextResponse } = require("next/server") export const GET=async()=>{ return NextResponse.json({'name':"your name"}) }
const { NextResponse } = require("next/server") export const POST=async()=>{ return NextResponse.json({'name':"your name"}) }
const { NextResponse } = require("next/server") export const DELETE=async()=>{ return NextResponse.json({'name':"your name"}) }
const { NextResponse } = require("next/server") export const UPDATE=async()=>{ return NextResponse.json({'name':"your name"}) }