Unverified Commit 76c0efb3 authored by Erik August Johnson's avatar Erik August Johnson Committed by GitHub

Update README-template.md for API endpoint info (#20024)

Adds brief summary in Getting Started to explain the `pages/api` functionality. The intention here is reduce confusion to new users of Next.js as to what `pages/api` is and how it works.
parent 114f4801
...@@ -14,6 +14,10 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the ...@@ -14,6 +14,10 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
## Learn More ## Learn More
To learn more about Next.js, take a look at the following resources: To learn more about Next.js, take a look at the following resources:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment