0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-23 21:53:55 -05:00

Opening app to all IPs instead of localhost (#1339)

I see people often ask about opening up the app to local network so this looked like a good place to explain how to do it.
This commit is contained in:
Aleš Vaupotič 2021-09-08 19:36:00 +02:00 committed by GitHub
parent d71b75b2a6
commit d1370e9d69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,7 +139,15 @@ You can create more pages in the `src/pages` directory, and Astro will use the f
npm run dev npm run dev
``` ```
Astro will now start serving your application on `http://localhost:3000`. By opening this URL in your browser, you should see the Astro's “Hello, World” Astro will now start serving your application on `http://localhost:3000`. By opening this URL in your browser, you should see the Astro's “Hello, World”.
If you need to share your development progress on the local network or check out the app from a phone, just add the following [snowpack](https://www.snowpack.dev/reference/configuration#devoptionshostname) option to `astro.config.mjs`:
```js
devOptions: {
hostname: "0.0.0.0"
}
```
## [Build Astro](#build-astro) ## [Build Astro](#build-astro)