How to expose port in Astro dev server
/ 1 min read
Table of Contents
Intro
By default, Astro dev server only expose port to localhost. But sometimes we need to expose port to network so that other devices can access it. Here’s how to do it.
How to
Start the Astro dev server with the --host flag.
$ npx astro dev --host 0.0.0.0 --port 4321Check the Windows firewall to make sure that the port is open
C:\Users\hiiruki> netstat -an | findstr 4321TCP 127.0.0.1:4321 0.0.0.0:0 LISTENING