🌠 API Routes

Create a basic API endpoint

file_type_typescript route.ts
import { NextResponse } from 'next/server';

// Dummy data
const posts = [
  {
    title: 'Lorem Ipsum',
    slug: 'lorem-ipsum',
    content:
      'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero.',
  },
];

export async function GET() {
  return NextResponse.json(posts);
}

Questions? Let's chat

Open Discord