Careeroza
The public Folder
Static Files
Files in public/ are served from the site root, exactly as they are.
| File | URL |
|---|---|
public/logo.svg | /logo.svg |
public/banners/diwali.webp | /banners/diwali.webp |
public/robots.txt | /robots.txt (or generate it with app/robots.ts) |
Example
curl -I http://localhost:3000/logo.svgExample output
HTTP/1.1 200 OK Content-Type: image/svg+xml Cache-Control: public, max-age=0
Things to Know
- Do not name a file in
public/the same as a route (public/productsvsapp/products). - Files added after
next buildare not served bynext startin all setups. Treatpublic/as build-time content; put user uploads in cloud storage (S3, Cloudinary, GCS).