Unverified Commit 1d5338f7 authored by Jam Balaya's avatar Jam Balaya Committed by GitHub

examples: update `next-config-js` document path (#73774)

## Description

Follow up #72465.
Update [`next-config-js`
document](https://nextjs.org/docs/canary/app/api-reference/config/next-config-js)
URL.

### Before

https://nextjs.org/docs/api-reference/next-config-js

### After

https://nextjs.org/docs/api-reference/config/next-config-js

### Adding or Updating Examples

- [x] The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- [x] Make sure the linting passes by running `pnpm build && pnpm lint`.
See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

CC: @samcx
Co-authored-by: 's avatarSam Ko <sam@vercel.com>
parent 8f99e6b0
# Headers Example
This example shows how to use [headers in Next.js](https://nextjs.org/docs/app/api-reference/next-config-js/headers) to add custom HTTP headers into your Next.js app.
This example shows how to use [headers in Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/headers) to add custom HTTP headers into your Next.js app.
The index page ([`app/page.tsx`](app/page.tsx)) has a list of links to pages with custom headers set up in [`next.config.js`](next.config.js). Run or deploy the app to see how it works!
......
......@@ -11,7 +11,7 @@ export default function Index() {
<p>
The links below are examples of{" "}
<Link
href="https://nextjs.org/docs/app/api-reference/next-config-js/headers"
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/headers"
legacyBehavior
>
<span>
......
# Rewrites Example
This example shows how to use [rewrites in Next.js](https://nextjs.org/docs/app/api-reference/next-config-js/rewrites) to map an incoming request path to a different destination path.
This example shows how to use [rewrites in Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites) to map an incoming request path to a different destination path.
The index page ([`app/page.tsx`](app/page.ts)) has a list of links that match the rewrites defined in [`next.config.js`](next.config.js). Run or deploy the app to see how it works!
......
......@@ -11,7 +11,7 @@ export default function Index() {
<p>
The links below are{" "}
<Link
href="https://nextjs.org/docs/app/api-reference/next-config-js/rewrites"
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites"
legacyBehavior
>
<span>
......
......@@ -61,6 +61,6 @@ EXPOSE 3000
ENV PORT=3000
# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
# https://nextjs.org/docs/pages/api-reference/config/next-config-js/output
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]
......@@ -5,7 +5,7 @@ This is an example that demonstrates how to serve multiple Next.js applications
Multi Zones are an approach to micro-frontends that separate a single large application on a domain into smaller applications that each serve a set of paths.
This is useful when there are collections of pages unrelated to the other pages in the application. By moving those pages to a separate zone, you can reduce the size of the application which improves build times and removes code that is only necessary for one of the zones.
Multi-Zone applications work by having one of the applications route requests for some paths to the other pages using the [`rewrites` feature](https://nextjs.org/docs/pages/api-reference/next-config-js/rewrites) of `next.config.js`. All URL paths should be unique across all the zones for the domain. For example:
Multi-Zone applications work by having one of the applications route requests for some paths to the other pages using the [`rewrites` feature](https://nextjs.org/docs/pages/api-reference/config/next-config-js/rewrites) of `next.config.js`. All URL paths should be unique across all the zones for the domain. For example:
- There are two zones in this application: `home` and `blog`.
- The `home` app is the main app and therefore it includes the rewrites that map to the `blog` app in [next.config.js](home/next.config.js)
......@@ -13,7 +13,7 @@ Multi-Zone applications work by having one of the applications route requests fo
- `blog` will serve the `/blog` and `/blog/*` paths.
- The `blog` app sets [`basePath`](https://nextjs.org/docs/api-reference/next.config.js/basepath) to `/blog` so that generated pages, Next.js assets and public assets are unique to the `blog` zone and won't conflict with anything from the other zones.
NOTE: A `basePath` will prefix all pages in the application with the `basePath` automatically, including relative links. If you have many pages that don't share the same path prefix (for example, `/home` and `/blog` live in the same zone), you can use [`assetPrefix`](https://nextjs.org/docs/app/api-reference/next-config-js/assetPrefix) to add a unique prefix for Next.js assets without affecting the other pages.
NOTE: A `basePath` will prefix all pages in the application with the `basePath` automatically, including relative links. If you have many pages that don't share the same path prefix (for example, `/home` and `/blog` live in the same zone), you can use [`assetPrefix`](https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix) to add a unique prefix for Next.js assets without affecting the other pages.
## How to use
......
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