[object Object]

← back to Goodquestion Ai

Bind dev/preview to all IPv4 (host:true) so 127.0.0.1:4321 works

93eadf706c3f091c0121f029e1d41bd2ea09b299 · 2026-07-27 08:48:52 -0700 · Steve

Astro's localhost default bound IPv6-only (::1), refusing http://127.0.0.1.
Added server.host + --host to dev/start/preview.

Files touched

Diff

commit 93eadf706c3f091c0121f029e1d41bd2ea09b299
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jul 27 08:48:52 2026 -0700

    Bind dev/preview to all IPv4 (host:true) so 127.0.0.1:4321 works
    
    Astro's localhost default bound IPv6-only (::1), refusing http://127.0.0.1.
    Added server.host + --host to dev/start/preview.
---
 astro.config.mjs | 4 ++++
 package.json     | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/astro.config.mjs b/astro.config.mjs
index d01a764..df431c3 100644
--- a/astro.config.mjs
+++ b/astro.config.mjs
@@ -6,4 +6,8 @@ export default defineConfig({
   site: 'https://goodquestion.ai',
   integrations: [mdx(), sitemap()],
   output: 'static',
+  // Bind dev/preview to all IPv4 interfaces (0.0.0.0) instead of Astro's
+  // IPv6-only `localhost` default, so http://127.0.0.1:4321/ and LAN devices
+  // both connect. Without this, only http://localhost (::1) resolves.
+  server: { host: true },
 });
diff --git a/package.json b/package.json
index 03651df..de1c7c2 100644
--- a/package.json
+++ b/package.json
@@ -4,10 +4,10 @@
   "version": "1.0.0",
   "description": "Agent Abrams - A developer's journey with Claude Code",
   "scripts": {
-    "dev": "astro dev",
-    "start": "astro dev",
+    "dev": "astro dev --host",
+    "start": "astro dev --host",
     "build": "astro build",
-    "preview": "astro preview",
+    "preview": "astro preview --host",
     "astro": "astro"
   },
   "dependencies": {

← 935c3cb Env-ify capture scripts: remove leaked DWSecure2024! passwor  ·  back to Goodquestion Ai  ·  chore: v1.0.1 (session close — IPv4 dev-bind fix) 8555b26 →