Skip to content

API Routes

If you’re continuing from the previous lesson, you can skip this page. Click the button below to go to the next page.

Download Starter Code (Optional)

If you’re NOT continuing from the previous lesson, you can download, install, and run the starter code for this lesson below. This sets up a nextjs-blog directory such that it’s identical to the result of the previous lesson.

Again, this is NOT necessary if you’ve just finished the previous lesson.

npx create-next-app@latest nextjs-blog --use-npm --example "https://github.com/vercel/next-learn/tree/main/basics/api-routes-starter"

Then follow the instructions from the command output (cd into the directory and start the development server).

You should also update the following files:

  • public/images/profile.jpg with your photo (Recommended: 400px width/height).
  • const name = '[Your Name]' in components/layout.js with your name.
  • <p>[Your Self Introduction]</p> in pages/index.js with your self introduction.