0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

feat: change default port to 4321 (#7874)

Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
This commit is contained in:
Emanuele Stoppa 2023-08-01 16:31:42 +01:00
parent dc13687bb4
commit f01eb585e7
75 changed files with 108 additions and 101 deletions

View file

@ -0,0 +1,7 @@
---
'astro': major
---
Astro's default port when running the dev or preview server is now `4321`.
This will reduce conflicts with ports used by other tools.

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/basics", "workspaceFolder": "/workspaces/astro/examples/basics",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/blog", "workspaceFolder": "/workspaces/astro/examples/blog",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/deno", "workspaceFolder": "/workspaces/astro/examples/deno",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/docs", "workspaceFolder": "/workspaces/astro/examples/docs",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/framework-alpine", "workspaceFolder": "/workspaces/astro/examples/framework-alpine",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/framework-lit", "workspaceFolder": "/workspaces/astro/examples/framework-lit",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/framework-multiple", "workspaceFolder": "/workspaces/astro/examples/framework-multiple",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/framework-preact", "workspaceFolder": "/workspaces/astro/examples/framework-preact",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/framework-react", "workspaceFolder": "/workspaces/astro/examples/framework-react",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/framework-solid", "workspaceFolder": "/workspaces/astro/examples/framework-solid",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/framework-svelte", "workspaceFolder": "/workspaces/astro/examples/framework-svelte",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/framework-vue", "workspaceFolder": "/workspaces/astro/examples/framework-vue",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/hackernews", "workspaceFolder": "/workspaces/astro/examples/hackernews",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/minimal", "workspaceFolder": "/workspaces/astro/examples/minimal",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/non-html-pages", "workspaceFolder": "/workspaces/astro/examples/non-html-pages",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/portfolio", "workspaceFolder": "/workspaces/astro/examples/portfolio",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/ssr", "workspaceFolder": "/workspaces/astro/examples/ssr",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/with-markdown-plugins", "workspaceFolder": "/workspaces/astro/examples/with-markdown-plugins",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/with-markdown-shiki", "workspaceFolder": "/workspaces/astro/examples/with-markdown-shiki",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/with-mdx", "workspaceFolder": "/workspaces/astro/examples/with-mdx",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/with-nanostores", "workspaceFolder": "/workspaces/astro/examples/with-nanostores",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/with-tailwindcss", "workspaceFolder": "/workspaces/astro/examples/with-tailwindcss",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/with-vite-plugin-pwa", "workspaceFolder": "/workspaces/astro/examples/with-vite-plugin-pwa",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -7,13 +7,13 @@
"workspaceFolder": "/workspaces/astro/examples/with-vitest", "workspaceFolder": "/workspaces/astro/examples/with-vitest",
"portsAttributes": { "portsAttributes": {
"3000": { "4321": {
"label": "Application", "label": "Application",
"onAutoForward": "openPreview" "onAutoForward": "openPreview"
} }
}, },
"forwardPorts": [3000], "forwardPorts": [4321],
"postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build", "postCreateCommand": "pnpm install && cd /workspaces/astro && pnpm run build",

View file

@ -18,7 +18,7 @@ vscode:
- esbenp.prettier-vscode - esbenp.prettier-vscode
- dbaeumer.vscode-eslint - dbaeumer.vscode-eslint
ports: ports:
- port: 3000 - port: 4321
onOpen: open-preview onOpen: open-preview
github: github:
prebuilds: prebuilds:

View file

@ -43,7 +43,7 @@ All commands are run from the root of the project, from a terminal:
| Command | Action | | Command | Action |
| :------------------------ | :----------------------------------------------- | | :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies | | `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` | | `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` | | `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying | | `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -53,7 +53,7 @@ All commands are run from the root of the project, from a terminal:
| Command | Action | | Command | Action |
| :------------------------ | :----------------------------------------------- | | :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies | | `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` | | `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` | | `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying | | `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -42,7 +42,7 @@ All commands are run from the root of the project, from a terminal:
| Command | Action | | Command | Action |
| :------------------------ | :----------------------------------------------- | | :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies | | `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` | | `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` | | `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying | | `npm run preview` | Preview your build locally, before deploying |
| | (preview uses Deno CLI) | | | (preview uses Deno CLI) |

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -48,7 +48,7 @@ All commands are run from the root of the project, from a terminal:
| Command | Action | | Command | Action |
| :------------------------ | :----------------------------------------------- | | :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies | | `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` | | `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` | | `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying | | `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -36,7 +36,7 @@ All commands are run from the root of the project, from a terminal:
| Command | Action | | Command | Action |
| :------------------------ | :----------------------------------------------- | | :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies | | `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` | | `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` | | `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying | | `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -41,7 +41,7 @@ All commands are run from the root of the project, from a terminal:
| Command | Action | | Command | Action |
| :------------------------ | :----------------------------------------------- | | :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies | | `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` | | `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` | | `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying | | `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -19,7 +19,7 @@ All commands are run from the root of the project, from a terminal:
| Command | Action | | Command | Action |
| :------------------------ | :----------------------------------------------- | | :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies | | `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` | | `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` | | `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying | | `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -45,7 +45,7 @@ All commands are run from the root of the project, from a terminal:
| Command | Action | | Command | Action |
| :------------------------ | :----------------------------------------------- | | :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies | | `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` | | `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` | | `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying | | `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -36,7 +36,7 @@ All commands are run from the root of the project, from a terminal:
| Command | Action | | Command | Action |
| :------------------------ | :----------------------------------------------- | | :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies | | `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:3000` | | `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` | | `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying | | `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -4,7 +4,7 @@
"view": "browser", "view": "browser",
"template": "node", "template": "node",
"container": { "container": {
"port": 3000, "port": 4321,
"startScript": "start", "startScript": "start",
"node": "14" "node": "14"
} }

View file

@ -327,7 +327,7 @@ type ServerConfig = {
/** /**
* @name server.port * @name server.port
* @type {number} * @type {number}
* @default `3000` * @default `4321`
* @description * @description
* Set which port the dev server should listen on. * Set which port the dev server should listen on.
* *
@ -915,7 +915,7 @@ export interface AstroUserConfig {
* ```js * ```js
* { * {
* // Example: Use the function syntax to customize based on command * // Example: Use the function syntax to customize based on command
* server: ({ command }) => ({ port: command === 'dev' ? 3000 : 4000 }) * server: ({ command }) => ({ port: command === 'dev' ? 4321 : 4000 })
* } * }
* ``` * ```
*/ */
@ -937,7 +937,7 @@ export interface AstroUserConfig {
* @docs * @docs
* @name server.port * @name server.port
* @type {number} * @type {number}
* @default `3000` * @default `4321`
* @description * @description
* Set which port the server should listen on. * Set which port the server should listen on.
* *

View file

@ -15,7 +15,7 @@ export async function dev({ flags }: DevOptions) {
usage: '[...flags]', usage: '[...flags]',
tables: { tables: {
Flags: [ Flags: [
['--port', `Specify which port to run on. Defaults to 3000.`], ['--port', `Specify which port to run on. Defaults to 4321.`],
['--host', `Listen on all addresses, including LAN and public addresses.`], ['--host', `Listen on all addresses, including LAN and public addresses.`],
['--host <custom-address>', `Expose on a network IP address at <custom-address>`], ['--host <custom-address>', `Expose on a network IP address at <custom-address>`],
['--open', 'Automatically open the app in the browser on server start'], ['--open', 'Automatically open the app in the browser on server start'],

View file

@ -32,7 +32,7 @@ const ASTRO_CONFIG_DEFAULTS = {
compressHTML: false, compressHTML: false,
server: { server: {
host: false, host: false,
port: 3000, port: 4321,
open: false, open: false,
}, },
integrations: [], integrations: [],

View file

@ -131,8 +131,8 @@ describe('astro cli', () => {
// Note: our tests run in parallel so this could be 3000+! // Note: our tests run in parallel so this could be 3000+!
expect(Number.parseInt(localURL.port)).to.be.greaterThanOrEqual( expect(Number.parseInt(localURL.port)).to.be.greaterThanOrEqual(
3000, 4321,
`Expected Port to be >= 3000` `Expected Port to be >= 4321`
); );
expect(networkURL.port).to.be.equal( expect(networkURL.port).to.be.equal(
localURL.port, localURL.port,

View file

@ -5,5 +5,5 @@ import preact from '@astrojs/preact';
export default defineConfig({ export default defineConfig({
integrations: [preact()], integrations: [preact()],
// make sure CLI flags have precedence // make sure CLI flags have precedence
server: () => ({ port: 3000 }) server: () => ({ port: 4321 })
}); });

View file

@ -1,7 +1,7 @@
export default () => { export default () => {
// noop // noop
return { return {
port: 3000, port: 4321,
closed() {}, closed() {},
stop() {} stop() {}
} }

View file

@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'http://localhost:3000', site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })] integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
}); });

View file

@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'http://localhost:3000', site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })] integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
}); });

View file

@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'http://localhost:3000', site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })] integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
}); });

View file

@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'http://localhost:3000', site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })] integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
}); });

View file

@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'http://localhost:3000', site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })] integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
}); });

View file

@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'http://localhost:3000', site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })] integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
}); });

View file

@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'http://localhost:3000', site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })] integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' })]
}); });

View file

@ -3,6 +3,6 @@ import image from '@astrojs/image';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'http://localhost:3000', site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent' })] integrations: [image({ logLevel: 'silent' })]
}); });

View file

@ -4,6 +4,6 @@ import mdx from '@astrojs/mdx';
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
site: 'http://localhost:3000', site: 'http://localhost:4321',
integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' }), mdx()] integrations: [image({ logLevel: 'silent', serviceEntryPoint: '@astrojs/image/sharp' }), mdx()]
}); });

View file

@ -159,7 +159,7 @@ For standalone mode the server handles file servering in addition to the page an
You can override the host and port the standalone server runs on by passing them as environment variables at runtime: You can override the host and port the standalone server runs on by passing them as environment variables at runtime:
```shell ```shell
HOST=0.0.0.0 PORT=3000 node ./dist/server/entry.mjs HOST=0.0.0.0 PORT=4321 node ./dist/server/entry.mjs
``` ```
#### HTTPS #### HTTPS

View file

@ -25,7 +25,7 @@ const config = {
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 0, actionTimeout: 0,
/* Base URL to use in actions like `await page.goto('/')`. */ /* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3000', baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:4321',
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry', trace: 'on-first-retry',