You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: next-basics.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Next.js is a React framework built on top of React that provides:
56
56
57
57
-**API routes** to build backend endpoints in the same project — Files inside `app/api/` export HTTP handler functions (`GET`, `POST`, etc.), allowing you to write backend logic without a separate server. Ideal for form submissions, webhooks, and database queries.
58
58
59
-
-**Automatic code splitting** per page — Next.js only sends the JavaScript needed for the current page. Users don't download code for routes they haven't visited, resulting in faster initial load times.
59
+
-**Automatic code splitting** per page — Next.js only sends the JavaScript needed for the current page. Users don\'t download code for routes they haven\'t visited, resulting in faster initial load times.
60
60
61
61
-**Built-in image optimization** via `next/image` — The `<Image>` component automatically resizes, compresses, converts to modern formats (WebP/AVIF), and lazy-loads images. This eliminates the manual work of optimizing assets for different screen sizes.
62
62
@@ -748,7 +748,7 @@ These hooks are Client Component hooks ("`use client`") imported from `next/navi
748
748
749
749
**1. usePathname**
750
750
751
-
Reads the current URL's path name (the string after the domain name, excluding query parameters).
751
+
Reads the current URL\'s path name (the string after the domain name, excluding query parameters).
752
752
753
753
***URL Example**: `https://example.com`
754
754
***Returned Value**: `"/dashboard/settings"` (as a string)
@@ -2608,7 +2608,7 @@ export function RoleBadge() {
2608
2608
2609
2609
## Q. How do you implement geolocation-based routing in Next.js Middleware?
2610
2610
2611
-
Next.js Middleware on Vercel automatically populates `request.geo` with the visitor's country, region, and city, derived from the request IP — no extra library needed.
2611
+
Next.js Middleware on Vercel automatically populates `request.geo` with the visitor\'s country, region, and city, derived from the request IP — no extra library needed.
## Q. How do you containerize a Next.js app with Docker?
2875
2875
2876
-
To containerize a Next.js app with Docker, the best practice is to utilize multi-stage builds and Next.js's built-in **standalone output**. This approach creates a self-contained, minimal Node.js server rather than copying your entire `node_modules` folder, shrinking the final image size from over 1GB to roughly 170MB
2876
+
To containerize a Next.js app with Docker, the best practice is to utilize multi-stage builds and Next.js\'s built-in **standalone output**. This approach creates a self-contained, minimal Node.js server rather than copying your entire `node_modules` folder, shrinking the final image size from over 1GB to roughly 170MB
2877
2877
2878
2878
**Step 1: Configure Next.js for Standalone Output**
2879
2879
@@ -3158,7 +3158,7 @@ import { cacheLife } from 'next/cache';
0 commit comments