# node requirement v18.19.0+
// need to modify nextConfig const nextConfig = { appDir: true, }
// layout moves src/pages/_app.tsx >>> src/app/layout.tsx // page moves src/pages/index.tsx >>> src/app/page.tsx
Every endpoint is now a route.ts
inside of a api
subdirectory
app/api/route.ts app/api/accounts/login/route.ts
import { NextRequest, NextResponse } from "next/server";
<Links>
For existing links in NextJS 12, you have to run the following command to retrofit them to NextJS 13 format
npx @next/codemod@latest new-link .
NextJS 13
now not using an <a>
tag underneath the Link componentSlugs can be referenced in NextJS 13
via params.slug
// app/blog/[slug]/page.js // /blog/a // { slug: 'a' } export default function Page({ params }: { params: { slug: string } }) { return <div>My Post: {params.slug}</div> }