MinJeung-Kim / NextJS-v13--Study

Next.js(v13)의 모든것😎
https://next-js-v13-study.vercel.app
0 stars 0 forks source link

API 라우트 #20

Open MinJeung-Kim opened 1 year ago

MinJeung-Kim commented 1 year ago

⁉️What's API Route

image

// app/api/products/route.ts

import { getProducts } from "@/service/products";
import { NextResponse } from "next/server";

export async function GET(request: Request) {
  const products = await getProducts();
  return NextResponse.json({ products });
}

image

MinJeung-Kim commented 1 year ago

⁉️What's Serverless

개발자가 직접 서버를 관리할 경우 문제

Serverless Way

Serverless 문제점