Previewing your site
What "localhost" means and how to check your changes before they go live.
Before you publish anything, you look at it on your own computer first. That's called the preview. Only you can see it.
#What is "localhost"?
When your AI assistant starts the preview, you get an address like:
http://localhost:5173localhost means "this computer". So your website isn't running on the internet, but on your own
computer. The number after it (5173 or 3000) is a kind of house number; it can differ from time
to time. Use the address your AI gives you.
- Does the address only work on your computer? Yes, and that's exactly the idea.
- Can a customer see this already? No. Only once you publish does the rest of the world see your changes.
#Starting and stopping the preview
Easiest: ask your AI.
- "Start the preview of my website."
- "Stop the preview."
You can also do it yourself, in your website's folder:
npm run devStop it with Ctrl+C in that terminal window.
#Checking your changes
Keep the preview open in your browser. When your AI changes something, the page usually refreshes by itself. If not, press F5 (Mac: ⌘ Cmd+R).
#Preview not working?
- "This site can't be reached": the preview hasn't started (yet), or has stopped. Ask your AI to start it again.
- An error message on the page: copy the message and paste it to your AI with "This is what I see in the preview, can you fix it?"
More fixes: troubleshooting.