You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.0 KiB
1.0 KiB
Local Subdomain Preview
Use a local subdomain-style URL instead of 127.0.0.1:3000.
Recommended URL
Modern browsers resolve *.localhost to the local machine automatically, so no /etc/hosts change is required.
http://popiart.localhost:3100/zhhttp://popiart.localhost:3100/enhttp://popiart.localhost:3100/zh/consolehttp://popiart.localhost:3100/zh/skills
Run
Development server:
npm run dev:subdomain
Production preview:
npm run build
npm run start:subdomain
Why this works
- The URL looks like a domain instead of
127.0.0.1. - It avoids port
3000and uses3100. - Session cookies stay same-origin because the app uses relative
/api/*routes.
If you need a real custom domain later
If you want a domain like console.popi.art locally, the next step is:
- Add a hosts mapping to
127.0.0.1. - Run a reverse proxy on port
80or443. - Point that domain to the Next.js app.
That is a separate setup from the zero-config *.localhost approach.