diff --git a/old-translations/de/installation.md b/old-translations/de/installation.md index 78cc8b147dd9a..ac3640b433ec9 100644 --- a/old-translations/de/installation.md +++ b/old-translations/de/installation.md @@ -99,7 +99,7 @@ Jetzt kannst du den Platzhalter im Abschnitt "scripts" deiner `package.json`-Dat } ``` -Der Befehl [`dev`](#start-astro) startet den Astro Entwicklungsserver auf `http://localhost:3000`. Sobald dein Projekt fertig ist, gibt der Befehl [`build`](#build-astro) dein Projekt in das Verzeichnis `dist/` aus. [Lese mehr über das Veröffentlichen von Astro-Builds](/guides/deploy). +Der Befehl [`dev`](#start-astro) startet den Astro Entwicklungsserver auf `http://localhost:4321`. Sobald dein Projekt fertig ist, gibt der Befehl [`build`](#build-astro) dein Projekt in das Verzeichnis `dist/` aus. [Lese mehr über das Veröffentlichen von Astro-Builds](/guides/deploy). ### Erstelle deine erste Seite @@ -145,7 +145,7 @@ Du kannst weitere Seiten im Verzeichnis `src/pages` erstellen - Astro verwendet npm run dev ``` -Astro wird von nun an deine Anwendung unter `http://localhost:3000` bereitstellen. Wenn du diese URL in deinem Browser öffnest, solltest du Astros "Hello, World" sehen. +Astro wird von nun an deine Anwendung unter `http://localhost:4321` bereitstellen. Wenn du diese URL in deinem Browser öffnest, solltest du Astros "Hello, World" sehen. Falls du deinen Entwicklungsfortschritt im lokalen Netzwerk teilen oder die Anwendung von einem Telefon aus testen möchtest, füge einfach die folgende Option in `astro.config.mjs` hinzu: diff --git a/old-translations/de/quick-start.md b/old-translations/de/quick-start.md index bde325c103c4b..afac060b67ac1 100644 --- a/old-translations/de/quick-start.md +++ b/old-translations/de/quick-start.md @@ -41,7 +41,7 @@ In deinem Projektverzeichnis führe den folgenden Befehl in deinem Terminal aus: npm run dev ``` -Astro wird von nun an deine Anwendung unter [http://localhost:3000](http://localhost:3000) bereitstellen. Wenn du diese URL in deinem Browser öffnest, solltest du Astros "Hello, World" sehen. +Astro wird von nun an deine Anwendung unter [http://localhost:4321](http://localhost:4321) bereitstellen. Wenn du diese URL in deinem Browser öffnest, solltest du Astros "Hello, World" sehen. Der Server wird nun auf alle Änderungen in deinem `src/`-Verzeichnisch lauschen, sodass du deine Anwendung nicht nach jeder Änderung neu starten musst. diff --git a/old-translations/es/installation.md b/old-translations/es/installation.md index 3dbf57b7485b5..fbb81e4fb1340 100644 --- a/old-translations/es/installation.md +++ b/old-translations/es/installation.md @@ -98,7 +98,7 @@ Ahora, puedes reemplazar la sección de "scripts" del archivo `package.json` que } ``` -El comando [`dev`](#start-astro) inicia el servidor de desarrollo de Astro en `http://localhost:3000`. Una vez que tu proyecto esté listo, el comando [`build`](#build-astro) genera tu proyecto en el directorio `dist/`. [Lee más sobre cómo desplegar Astro en la guía de despliegue](/es/guides/deploy). +El comando [`dev`](#start-astro) inicia el servidor de desarrollo de Astro en `http://localhost:4321`. Una vez que tu proyecto esté listo, el comando [`build`](#build-astro) genera tu proyecto en el directorio `dist/`. [Lee más sobre cómo desplegar Astro en la guía de despliegue](/es/guides/deploy). ### Crear tu primera página @@ -144,7 +144,7 @@ Puedes crear más páginas en el directorio `src/pages` y Astro utilizará los a npm run dev ``` -Ahora Astro estará corriendo tu aplicación en `http://localhost:3000`. Al abrir esta URL en tu navegador, deberías ver el “¡Hola, Mundo!” de Astro. +Ahora Astro estará corriendo tu aplicación en `http://localhost:4321`. Al abrir esta URL en tu navegador, deberías ver el “¡Hola, Mundo!” de Astro. Si necesitas compartir tu progreso de desarrollo en la red local o revisar la aplicación desde un teléfono, sólo agrega la siguiente opción en `astro.config.mjs`: diff --git a/old-translations/es/quick-start.md b/old-translations/es/quick-start.md index cbb2863b6c842..3b662de4e8598 100644 --- a/old-translations/es/quick-start.md +++ b/old-translations/es/quick-start.md @@ -39,7 +39,7 @@ Dentro del directorio de tu proyecto, ingresa el siguiente comando en la termina npm run dev ``` -Astro comenzará a correr en el servidor de desarrollo en [http://localhost:3000](http://localhost:3000). Abre esta ubicación en tu navegador, deberías ver la página de "¡Hola Mundo!" de Astro. +Astro comenzará a correr en el servidor de desarrollo en [http://localhost:4321](http://localhost:4321). Abre esta ubicación en tu navegador, deberías ver la página de "¡Hola Mundo!" de Astro. El servidor escuchará los cambios en vivo de los archivos en tu carpeta `src/`, así que, no necesitarás reiniciar la aplicación cuando hagas cambios durante el desarrollo. diff --git a/old-translations/fi/quick-start.md b/old-translations/fi/quick-start.md index 237bfb5ff0d64..08d2eb8b84a57 100644 --- a/old-translations/fi/quick-start.md +++ b/old-translations/fi/quick-start.md @@ -37,7 +37,7 @@ Siirry takaisin komentoriville ja suorita tämä komento projektin hakemistossa: npm run dev ``` -Tämän jälkeen ohjelma on käynnissä osoitteessa [http://localhost:3000](http://localhost:3000). Avaa tämä URL selaimessa nähdäksesi viestin "Moi maailma!", jonka kopioimme edellisessä vaiheessa. +Tämän jälkeen ohjelma on käynnissä osoitteessa [http://localhost:4321](http://localhost:4321). Avaa tämä URL selaimessa nähdäksesi viestin "Moi maailma!", jonka kopioimme edellisessä vaiheessa. Astro seuraa muutoksia `src/`-hakemiston sisällä, joten ohjelmaa ei tarvitse käynnistää uudelleen tehdessäsi muutoksia siihen koodatessasi. diff --git a/old-translations/fr/installation.md b/old-translations/fr/installation.md index fe01ea1ba594e..cddb4a2251b78 100644 --- a/old-translations/fr/installation.md +++ b/old-translations/fr/installation.md @@ -96,7 +96,7 @@ Vous pouvez aussi remplacer la section "scripts" du fichier `package.json` avec } ``` -La commande [`dev`](#start-astro) démarre le serveur de développement Astro à l'adresse `http://localhost:3000`. Une fois votre projet terminé, la commande [`build`](#build-astro) produit votre site dans le dossier `dist/`. [En savoir plus sur le déploiement d'un site développé avec Astro.](/guides/deploy) +La commande [`dev`](#start-astro) démarre le serveur de développement Astro à l'adresse `http://localhost:4321`. Une fois votre projet terminé, la commande [`build`](#build-astro) produit votre site dans le dossier `dist/`. [En savoir plus sur le déploiement d'un site développé avec Astro.](/guides/deploy) ### Créer une première page @@ -133,7 +133,7 @@ console.log('Coucou dans le terminal') Vous venez de lire un exemple de syntaxe des composants Astro, inspirée par le HTML et le JSX. -Vous pouvez continuer à ajouter des fichiers dans le dossier `src/pages`, et Astro se servira du nom du fichier pour ajouter des pages à votre site. Par exemple, si vous ajoutez une page `src/pages/a-propos.astro` (par exemple en reprenant le code ci-dessus), Astro va générer une nouvelle page à l'adresse `http://localhost:3000/a-propos`. +Vous pouvez continuer à ajouter des fichiers dans le dossier `src/pages`, et Astro se servira du nom du fichier pour ajouter des pages à votre site. Par exemple, si vous ajoutez une page `src/pages/a-propos.astro` (par exemple en reprenant le code ci-dessus), Astro va générer une nouvelle page à l'adresse `http://localhost:4321/a-propos`. ## [Démarrer Astro](#démarrer-astro) @@ -141,7 +141,7 @@ Vous pouvez continuer à ajouter des fichiers dans le dossier `src/pages`, et As npm run dev ``` -Astro va démarrer votre site à l'adresse `http://localhost:3000`. En ouvrant cette URL dans votre navigateur, vous devriez voir s'afficher "Hello, World", ou bien la page créée précédemment. +Astro va démarrer votre site à l'adresse `http://localhost:4321`. En ouvrant cette URL dans votre navigateur, vous devriez voir s'afficher "Hello, World", ou bien la page créée précédemment. ## [Compiler avec Astro](#compiler-avec-astro) diff --git a/old-translations/fr/quick-start.md b/old-translations/fr/quick-start.md index 2391b3303951d..aee90f214aab0 100644 --- a/old-translations/fr/quick-start.md +++ b/old-translations/fr/quick-start.md @@ -35,7 +35,7 @@ Depuis un terminal ouvert dans votre projet, entrez la commande suivante : npm run dev ``` -Astro va lancer un serveur local sur [http://localhost:3000](http://localhost:3000). Ouvrez cette adresse dans votre navigateur, et vous devriez voir le "Hello, World" d'Astro. +Astro va lancer un serveur local sur [http://localhost:4321](http://localhost:4321). Ouvrez cette adresse dans votre navigateur, et vous devriez voir le "Hello, World" d'Astro. Vous n'avez jamais besoin de redémarrer Astro : à chaque modification dans le dossier `src/`, le serveur recompile votre site. diff --git a/old-translations/hu/installation.md b/old-translations/hu/installation.md index 99e91fe659b85..dc7d4e2a85427 100644 --- a/old-translations/hu/installation.md +++ b/old-translations/hu/installation.md @@ -99,7 +99,7 @@ Következő lépésben lecserélheted az ideiglenes "scripts" szekciót a `packa } ``` -A [`dev`](#start-astro) parancs elindítja az Astro Fejlesztői Szerverét a `http://localhost:3000` címen. Amikor a projekted elkészül a [`build`](#build-astro) parancs megépíti a projektedet a `dist/` mappába. [Az Astro kiépítéséről többet olvashatsz a Kiépítési útmutatónkban.](/en/guides/deploy) +A [`dev`](#start-astro) parancs elindítja az Astro Fejlesztői Szerverét a `http://localhost:4321` címen. Amikor a projekted elkészül a [`build`](#build-astro) parancs megépíti a projektedet a `dist/` mappába. [Az Astro kiépítéséről többet olvashatsz a Kiépítési útmutatónkban.](/en/guides/deploy) ### Hozd létre az első oldalad @@ -145,7 +145,7 @@ Létrehozhatsz több oldalt az `src/pages` mappában. Az Astro a fájlok nevét npm run dev ``` -Az Astro mostantól a `http://localhost:3000` címen futtatja az alkalmazásodat. Ha megnyitod ezt a linket a böngésződben, látnod kell az Astro "Hello, World" mintaprogramját. +Az Astro mostantól a `http://localhost:4321` címen futtatja az alkalmazásodat. Ha megnyitod ezt a linket a böngésződben, látnod kell az Astro "Hello, World" mintaprogramját. Ha meg kell osztanod a helyi hálózaton, hogy hogyan halad a fejlesztés, vagy megnéznéd a mobilodról, csak add hozzá a következő opciót az `astro.config.mjs` fájlhoz: diff --git a/old-translations/hu/quick-start.md b/old-translations/hu/quick-start.md index a9e30aad7576b..4237bea9b9fbb 100644 --- a/old-translations/hu/quick-start.md +++ b/old-translations/hu/quick-start.md @@ -40,7 +40,7 @@ A projekted mappájában, írd be az alábbi parancsot a terminálba: npm run dev ``` -Mostantól az Astro alkalmazásod elérhető a [http://localhost:3000](http://localhost:3000) címen. Ha megnyitod ezt a címet a böngésződben, látnod kell az Astro saját "Hello, World"-jét. +Mostantól az Astro alkalmazásod elérhető a [http://localhost:4321](http://localhost:4321) címen. Ha megnyitod ezt a címet a böngésződben, látnod kell az Astro saját "Hello, World"-jét. A szerver autómatikusan figyeli az `src/` mappában történő változásokat, így nem kell újraindítanod az alkalmazást ha bármit módosítasz. diff --git a/old-translations/ja/installation.md b/old-translations/ja/installation.md index 205c5398535f9..a81558b3122d0 100644 --- a/old-translations/ja/installation.md +++ b/old-translations/ja/installation.md @@ -100,7 +100,7 @@ npm install astro } ``` -[`dev`](#astro-の開始)コマンドは、Astro Dev Server(`http://localhost:3000`)を起動します。プロジェクトの準備ができたら、[`build`](#astro-のビルド)コマンドで、プロジェクトを`dist/`ディレクトリに出力します。Astro のデプロイについては、[デプロイガイド](/guides/deploy)をご覧ください。 +[`dev`](#astro-の開始)コマンドは、Astro Dev Server(`http://localhost:4321`)を起動します。プロジェクトの準備ができたら、[`build`](#astro-のビルド)コマンドで、プロジェクトを`dist/`ディレクトリに出力します。Astro のデプロイについては、[デプロイガイド](/guides/deploy)をご覧ください。 ### 最初のページを作る @@ -146,7 +146,7 @@ console.log('これはターミナルに表示されます') npm run dev ``` -これで Astro は、`http://localhost:3000`でアプリケーションのサービスを開始します。この URL をブラウザで開くと、Astro の「Hello, World」が表示されるはずです。 +これで Astro は、`http://localhost:4321`でアプリケーションのサービスを開始します。この URL をブラウザで開くと、Astro の「Hello, World」が表示されるはずです。 開発の進捗状況をローカルネットワーク上で共有したり、スマートフォンからアプリを確認したければ、以下の オプションを`astro.config.mjs`に追加してください。 diff --git a/old-translations/ja/quick-start.md b/old-translations/ja/quick-start.md index 06e0d61f20aa0..1f5d86c4e1919 100644 --- a/old-translations/ja/quick-start.md +++ b/old-translations/ja/quick-start.md @@ -37,7 +37,7 @@ npm run build npm run dev ``` -これで Astro は、 [http://localhost:3000](http://localhost:3000)で、アプリケーションの提供を開始します。この URL をブラウザで開くと、Astro の「Hello, World」が表示されるはずです。 +これで Astro は、 [http://localhost:4321](http://localhost:4321)で、アプリケーションの提供を開始します。この URL をブラウザで開くと、Astro の「Hello, World」が表示されるはずです。 サーバーは、あなたの`src/`ディレクトリにあるファイルの変更を常に監視しているので、開発中に変更してもアプリケーションを再起動する必要はありません。 diff --git a/old-translations/nl/quick-start.md b/old-translations/nl/quick-start.md index 0c1aa791e8f48..279792de30cd8 100644 --- a/old-translations/nl/quick-start.md +++ b/old-translations/nl/quick-start.md @@ -38,7 +38,7 @@ Navigeer naar je project folder, en voer het volgende commando uit in je termina npm run dev ``` -Astro start nu je applicatie op, je kan deze vinden op [http://localhost:3000](http://localhost:3000). Als je deze URL opent zie je de Astro versie van "Hello, World". +Astro start nu je applicatie op, je kan deze vinden op [http://localhost:4321](http://localhost:4321). Als je deze URL opent zie je de Astro versie van "Hello, World". De server luistert naar live wijzifgingen in je `src/` folder, dus je hoeft de applicatie niet handmatig te herstarten bij elke wijziging tijdens de ontwikkeling. diff --git a/old-translations/ru/quick-start.md b/old-translations/ru/quick-start.md index 8718058a9b497..3ac324e88be4b 100644 --- a/old-translations/ru/quick-start.md +++ b/old-translations/ru/quick-start.md @@ -37,7 +37,7 @@ npm run build npm run dev ``` -Astro запустит сервер для разработки по адресу [http://localhost:3000](http://localhost:3000). При открытии этого URL в вашем браузере, вы должны увидеть "Hello, World" от Astro. +Astro запустит сервер для разработки по адресу [http://localhost:4321](http://localhost:4321). При открытии этого URL в вашем браузере, вы должны увидеть "Hello, World" от Astro. Сервер будет следить за изменениями в директории `src/`, значит вам не нужно будет перезапускать сервер каждый раз после внесения изменений. diff --git a/old-translations/zh-CN/installation.md b/old-translations/zh-CN/installation.md index 80ffbe335187c..bfe6e5ffe3983 100644 --- a/old-translations/zh-CN/installation.md +++ b/old-translations/zh-CN/installation.md @@ -102,7 +102,7 @@ npm install astro } ``` -[`dev`](#start-dev) 命令在 `http://localhost:3000` 上启动 Astro 开发服务器。一旦你的项目准备好了。 +[`dev`](#start-dev) 命令在 `http://localhost:4321` 上启动 Astro 开发服务器。一旦你的项目准备好了。 [`build`](#build-astro)命令将你的项目输出到 `dist/` 目录。[在部署指南中阅读更多关于部署 Astro 的内容。](/guides/deploy) @@ -149,7 +149,7 @@ console.log('See me in the Terminal') npm run dev ``` -Astro 会开启预览服务器,地址为 [http://localhost:3000](http://localhost:3000), +Astro 会开启预览服务器,地址为 [http://localhost:4321](http://localhost:4321), 在浏览器打开这个网址,就会看到 Astro 的 HelloWorld 页面 服务器会实时监听 'src/' 目录下的文件改动,所以在开发过程的支持热更新,修改程序后,无需重启。 diff --git a/old-translations/zh-CN/quick-start.md b/old-translations/zh-CN/quick-start.md index 1a94d74581842..0df701509c0ad 100644 --- a/old-translations/zh-CN/quick-start.md +++ b/old-translations/zh-CN/quick-start.md @@ -35,7 +35,7 @@ npm run build npm run dev ``` -Astro 会开启预览服务器,地址为 [http://localhost:3000](http://localhost:3000), +Astro 会开启预览服务器,地址为 [http://localhost:4321](http://localhost:4321), 在浏览器打开这个网址,就会看到 Astro 的 HelloWorld 页面 服务器会实时监听 'src/' 目录下的文件改动,所以在开发过程的支持热更新,修改程序后,无需重启。 diff --git a/old-translations/zh-TW/installation.md b/old-translations/zh-TW/installation.md index ff3d1bb410100..dde217ea07d98 100644 --- a/old-translations/zh-TW/installation.md +++ b/old-translations/zh-TW/installation.md @@ -98,7 +98,7 @@ npm install astro } ``` -[`dev`](#start-astro) 指令在 `http://localhost:3000` 啟動 Astro 開發伺服器。一但專案已經準備好,[`build`](#build-astro) 指令將專案輸出至 `dist/` 資料夾。[在「部署指南」深入閱讀部署 Astro](/guides/deploy)。 +[`dev`](#start-astro) 指令在 `http://localhost:4321` 啟動 Astro 開發伺服器。一但專案已經準備好,[`build`](#build-astro) 指令將專案輸出至 `dist/` 資料夾。[在「部署指南」深入閱讀部署 Astro](/guides/deploy)。 ### 建立第一個頁面 @@ -144,7 +144,7 @@ console.log('See me in the Terminal') npm run dev ``` -Astro 會為應用程式打開 `http://localhost:3000` 的伺服器。在瀏覽器開啟網址,就會看到 Astro 的「Hello World」。 +Astro 會為應用程式打開 `http://localhost:4321` 的伺服器。在瀏覽器開啟網址,就會看到 Astro 的「Hello World」。 ## [Build Astro](#build-astro) diff --git a/old-translations/zh-TW/quick-start.md b/old-translations/zh-TW/quick-start.md index 5eeff6e625dbc..d6c072b7a6041 100644 --- a/old-translations/zh-TW/quick-start.md +++ b/old-translations/zh-TW/quick-start.md @@ -35,7 +35,7 @@ npm run build npm run dev ``` -現在,Astro 就會開啟應用程式的伺服器,位置是 [http://localhost:3000](http://localhost:3000)。在瀏覽器打開這網址,就會看到 Astro 的 「Hello, World」。 +現在,Astro 就會開啟應用程式的伺服器,位置是 [http://localhost:4321](http://localhost:4321)。在瀏覽器打開這網址,就會看到 Astro 的 「Hello, World」。 伺服器會即時監聽 `src/` 資料夾的檔案異動,所以在開發過程的更新毋需重新啟動應用程式。 diff --git a/src/content/docs/de/guides/deploy/google-cloud.mdx b/src/content/docs/de/guides/deploy/google-cloud.mdx index ab39084fbc61b..e861bd6e75b4a 100644 --- a/src/content/docs/de/guides/deploy/google-cloud.mdx +++ b/src/content/docs/de/guides/deploy/google-cloud.mdx @@ -69,7 +69,7 @@ RUN pnpm run build ##### Dockerfile für SSR-Websites (Beispiel) -Das folgende Dockerfile erstellt deine Website und stellt sie mit Node.js (SSR-Adapter) auf Port `3000` bereit. +Das folgende Dockerfile erstellt deine Website und stellt sie mit Node.js (SSR-Adapter) auf Port `4321` bereit. ```docker title="Dockerfile" FROM node:lts AS runtime @@ -81,8 +81,8 @@ RUN npm install RUN npm run build ENV HOST=0.0.0.0 -ENV PORT=3000 -EXPOSE 3000 +ENV PORT=4321 +EXPOSE 4321 CMD node ./dist/server/entry.mjs ``` diff --git a/src/content/docs/de/guides/markdown-content.mdx b/src/content/docs/de/guides/markdown-content.mdx index 91748fa192b88..954bd30eeb6c9 100644 --- a/src/content/docs/de/guides/markdown-content.mdx +++ b/src/content/docs/de/guides/markdown-content.mdx @@ -13,7 +13,7 @@ Astro behandelt jede `.md`-Datei innerhalb des Verzeichnisses `/src/pages` als e ### Einfaches Beispiel -Der einfachste Einstieg in die Verwendung von Markdown mit Astro besteht darin, die Datei `src/pages/index.md` als Startseiten-Route für dein Projekt zu erstellen. Kopiere dann den untenstehenden Beispielinhalt in die Datei und sieh dir den gerenderten HTML-Code auf der Startseite deines Projekts an. Du findest sie normalerweise unter [http://localhost:3000/](http://localhost:3000/). +Der einfachste Einstieg in die Verwendung von Markdown mit Astro besteht darin, die Datei `src/pages/index.md` als Startseiten-Route für dein Projekt zu erstellen. Kopiere dann den untenstehenden Beispielinhalt in die Datei und sieh dir den gerenderten HTML-Code auf der Startseite deines Projekts an. Du findest sie normalerweise unter [http://localhost:4321/](http://localhost:4321/). ```markdown --- diff --git a/src/content/docs/de/guides/testing.mdx b/src/content/docs/de/guides/testing.mdx index fc6e1c9df9541..70c9b824e948f 100644 --- a/src/content/docs/de/guides/testing.mdx +++ b/src/content/docs/de/guides/testing.mdx @@ -57,14 +57,14 @@ Alternativ kannst du Playwright in deinem Astro-Projekt mit dem von dir gewählt ```jsx title="src/test/index.spec.ts" "Astro ist fantastisch!" test('Metadaten sind korrekt', async ({ page }) => { - await page.goto("http://localhost:3000/"); + await page.goto("http://localhost:4321/"); await expect(page).toHaveTitle('Astro ist fantastisch!'); }); ``` :::tip[Eine Basis-URL setzen] -Du kannst [`"baseURL": "http://localhost:3000"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in der `playwright.config.ts`-Konfigurationsdatei setzen, um `page.goto("/")` anstatt `page.goto("http://localhost:3000/")` als komfortablere URL zu nutzen. +Du kannst [`"baseURL": "http://localhost:4321"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in der `playwright.config.ts`-Konfigurationsdatei setzen, um `page.goto("/")` anstatt `page.goto("http://localhost:4321/")` als komfortablere URL zu nutzen. ::: ### Deine Playwright-Tests ausführen @@ -100,12 +100,12 @@ import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { webServer: { command: 'yarn preview', - url: 'http://localhost:3000/app/', + url: 'http://localhost:4321/app/', timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, use: { - baseURL: 'http://localhost:3000/app/', + baseURL: 'http://localhost:4321/app/', }, }; export default config; diff --git a/src/content/docs/de/install/auto.mdx b/src/content/docs/de/install/auto.mdx index dedc071526567..f4394a513e0b9 100644 --- a/src/content/docs/de/install/auto.mdx +++ b/src/content/docs/de/install/auto.mdx @@ -62,7 +62,7 @@ yarn run dev pnpm run dev ``` -Wenn alles gut geht, sollte dein Astro-Projekt jetzt unter [http://localhost:3000/](http://localhost:3000/) aufrufbar sein! +Wenn alles gut geht, sollte dein Astro-Projekt jetzt unter [http://localhost:4321/](http://localhost:4321/) aufrufbar sein! Astro überwacht zur Laufzeit alle Dateien im Verzeichnis `src/`, sodass du den Server nicht neu starten musst, wenn du während der Entwicklung Änderungen vornimmst. diff --git a/src/content/docs/de/reference/configuration-reference.mdx b/src/content/docs/de/reference/configuration-reference.mdx index 163ec637358a6..5a125469a8356 100644 --- a/src/content/docs/de/reference/configuration-reference.mdx +++ b/src/content/docs/de/reference/configuration-reference.mdx @@ -200,7 +200,7 @@ Um unterschiedliche Konfigurationen auf der Grundlage des ausgeführten Befehls { // Beispiel: Verwende die Funktionssyntax, um Anpassungen // auf der Grundlage des ausgeführten Befehls vorzunehmen - server: (command) => ({ port: command === 'dev' ? 3000 : 4000 }) + server: (command) => ({ port: command === 'dev' ? 4321 : 4000 }) } ``` @@ -224,7 +224,7 @@ Legt fest, unter welchen Netzwerk-IP-Adressen der Entwicklungsserver erreichbar

**Typ:** `number`
-**Standard:** `3000` +**Standard:** `4321`

Legt fest, unter welchem Port der Entwicklungsserver erreichbar sein soll. diff --git a/src/content/docs/en/guides/cms/contentful.mdx b/src/content/docs/en/guides/cms/contentful.mdx index 877b8f8e21885..491f8c5b2058c 100644 --- a/src/content/docs/en/guides/cms/contentful.mdx +++ b/src/content/docs/en/guides/cms/contentful.mdx @@ -424,7 +424,7 @@ const { content, title, date } = Astro.props; ``` -Navigate to http://localhost:3000/ and click on one of your posts to make sure your dynamic route is working! +Navigate to http://localhost:4321/ and click on one of your posts to make sure your dynamic route is working! #### Server side rendering diff --git a/src/content/docs/en/guides/cms/keystatic.mdx b/src/content/docs/en/guides/cms/keystatic.mdx index b08e9e13cd9df..ceab6817dc87d 100644 --- a/src/content/docs/en/guides/cms/keystatic.mdx +++ b/src/content/docs/en/guides/cms/keystatic.mdx @@ -161,7 +161,7 @@ The following steps will create a dashboard that lives in `src/pages/keystatic/` npm run dev ``` -5. Visit `http://127.0.0.1:3000/keystatic` in the browser to see the Keystatic Admin UI running. +5. Visit `http://127.0.0.1:4321/keystatic` in the browser to see the Keystatic Admin UI running. ## Creating a new post diff --git a/src/content/docs/en/guides/cms/kontent-ai.mdx b/src/content/docs/en/guides/cms/kontent-ai.mdx index 695dfd649cf75..ee79374e5457c 100644 --- a/src/content/docs/en/guides/cms/kontent-ai.mdx +++ b/src/content/docs/en/guides/cms/kontent-ai.mdx @@ -438,7 +438,7 @@ const blogPost: BlogPost = Astro.props.blogPost ``` -Navigate to your Astro preview (http://localhost:3000/blog/astro-is-amazing/ by default) to see the rendered blog post. +Navigate to your Astro preview (http://localhost:4321/blog/astro-is-amazing/ by default) to see the rendered blog post. #### Server-side rendering diff --git a/src/content/docs/en/guides/cms/payload.mdx b/src/content/docs/en/guides/cms/payload.mdx index a4bce5e1dbc2d..47d05fdd89fb0 100644 --- a/src/content/docs/en/guides/cms/payload.mdx +++ b/src/content/docs/en/guides/cms/payload.mdx @@ -73,7 +73,7 @@ import Users from "./collections/Users"; import Posts from "./collections/Posts"; export default buildConfig({ - serverURL: "http://localhost:3000", + serverURL: "http://localhost:4321", admin: { user: Users.slug, }, @@ -91,7 +91,7 @@ This will make a new collection called "Posts" appear in your PayloadCMS Dashboa 2. Enter the "Posts" collection and create a new post. After saving it, you will notice the API URL appear in the bottom right corner. -3. With the dev server running, open `http://localhost:3000/api/posts` in your browser. You should see a JSON file containing the post you have created as an object. +3. With the dev server running, open `http://localhost:4321/api/posts` in your browser. You should see a JSON file containing the post you have created as an object. ```json { @@ -118,7 +118,7 @@ This will make a new collection called "Posts" appear in your PayloadCMS Dashboa ``` :::tip -By default, both Astro and PayloadCMS will use port 3000. You might want to change the PayloadCMS port in the `src/server.ts` file. Don't forget to update the `serverURL` in `src/payload.config.ts` as well. +By default, both Astro and PayloadCMS will use port 4321. You might want to change the PayloadCMS port in the `src/server.ts` file. Don't forget to update the `serverURL` in `src/payload.config.ts` as well. ::: ### Fetching Data @@ -133,7 +133,7 @@ For example, to display a list of post titles and their content: --- import HomeLayout from "../layouts/HomeLayout.astro"; -const res = await fetch("https://localhost:5000/api/posts") // https://localhost:3000/api/posts by default +const res = await fetch("http://localhost:5000/api/posts") // http://localhost:4321/api/posts by default const posts = await res.json() --- @@ -161,7 +161,7 @@ Fetching via the API returns an array of objects (posts) that include, among oth --- import HomeLayout from "../layouts/HomeLayout.astro"; -const res = await fetch("http://localhost:5000/api/posts") // https://localhost:3000/api/posts by default +const res = await fetch("http://localhost:5000/api/posts") // http://localhost:4321/api/posts by default const posts = await res.json() --- diff --git a/src/content/docs/en/guides/testing.mdx b/src/content/docs/en/guides/testing.mdx index 41e35e1b3ba12..d35311b10c67e 100644 --- a/src/content/docs/en/guides/testing.mdx +++ b/src/content/docs/en/guides/testing.mdx @@ -80,7 +80,7 @@ export default defineConfig({ ```js title="cypress/e2e/index.cy.js" it('titles are correct', () => { - const page = cy.visit('http://localhost:3000'); + const page = cy.visit('http://localhost:4321'); page.get('title').should('have.text', 'Astro is awesome!') page.get('h1').should('have.text', 'Hello world from Astro'); @@ -88,7 +88,7 @@ export default defineConfig({ ``` :::tip[set a baseUrl] - You can set [`"baseUrl": "http://localhost:3000"`](https://docs.cypress.io/guides/end-to-end-testing/testing-your-app#Step-3-Configure-Cypress) in the `cypress.config.js` configuration file to use `cy.visit("/")` instead of `cy.visit("http://localhost:3000/")` for a more convenient URL. + You can set [`"baseUrl": "http://localhost:4321"`](https://docs.cypress.io/guides/end-to-end-testing/testing-your-app#Step-3-Configure-Cypress) in the `cypress.config.js` configuration file to use `cy.visit("/")` instead of `cy.visit("http://localhost:4321/")` for a more convenient URL. ::: ### Running your Cypress tests @@ -192,14 +192,14 @@ Alternatively, you can install Playwright within your Astro project using the pa import { test, expect } from '@playwright/test'; test('meta is correct', async ({ page }) => { - await page.goto("http://localhost:3000/"); + await page.goto("http://localhost:4321/"); await expect(page).toHaveTitle('Astro is awesome!'); }); ``` :::tip[set a baseurl] - You can set [`"baseURL": "http://localhost:3000"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the `playwright.config.ts` configuration file to use `page.goto("/")` instead of `page.goto("http://localhost:3000/")` for a more convenient URL. + You can set [`"baseURL": "http://localhost:4321"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) in the `playwright.config.ts` configuration file to use `page.goto("/")` instead of `page.goto("http://localhost:4321/")` for a more convenient URL. ::: ### Running your Playwright tests @@ -237,12 +237,12 @@ Here is an example of the configuration and commands required when using npm: export default defineConfig({ webServer: { command: 'npm run preview', - url: 'http://localhost:3000/', + url: 'http://localhost:4321/', timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, use: { - baseURL: 'http://localhost:3000/', + baseURL: 'http://localhost:4321/', }, }); ``` diff --git a/src/content/docs/en/install/auto.mdx b/src/content/docs/en/install/auto.mdx index 1f196f7d2056b..18dbb26d3eb55 100644 --- a/src/content/docs/en/install/auto.mdx +++ b/src/content/docs/en/install/auto.mdx @@ -81,7 +81,7 @@ Every starter template comes with a pre-configured script that will run `astro d -If all goes well, Astro should now be serving your project on [http://localhost:3000/](http://localhost:3000/)! +If all goes well, Astro should now be serving your project on [http://localhost:4321/](http://localhost:4321/)! Astro will listen for live file changes in your `src/` directory, so you will not need to restart the server as you make changes during development. diff --git a/src/content/docs/en/recipes/docker.mdx b/src/content/docs/en/recipes/docker.mdx index 3c4c09ceafbb2..325843d751b08 100644 --- a/src/content/docs/en/recipes/docker.mdx +++ b/src/content/docs/en/recipes/docker.mdx @@ -22,7 +22,7 @@ If you're using another package manager than npm, you'll need to adjust the comm ### SSR -This Dockerfile will build your site and serve it using Node.js on port `3000` and therefore requires the [Node adapter](/en/guides/integrations-guide/node/) installed in your Astro project. +This Dockerfile will build your site and serve it using Node.js on port `4321` and therefore requires the [Node adapter](/en/guides/integrations-guide/node/) installed in your Astro project. ```docker title="Dockerfile" FROM node:lts AS runtime @@ -34,8 +34,8 @@ RUN npm install RUN npm run build ENV HOST=0.0.0.0 -ENV PORT=3000 -EXPOSE 3000 +ENV PORT=4321 +EXPOSE 4321 CMD node ./dist/server/entry.mjs ``` @@ -155,8 +155,8 @@ COPY --from=prod-deps /app/node_modules ./node_modules COPY --from=build /app/dist ./dist ENV HOST=0.0.0.0 -ENV PORT=3000 -EXPOSE 3000 +ENV PORT=4321 +EXPOSE 4321 CMD node ./dist/server/entry.mjs ``` @@ -172,7 +172,7 @@ This will output an image, which you can run locally or deploy to a platform of 2. To run your image as a local container, use the following command. -Replace `` with an open port on your machine. Replace `` with the port exposed by your Docker container (`3000`, `80`, or `8080` in the above examples.) +Replace `` with an open port on your machine. Replace `` with the port exposed by your Docker container (`4321`, `80`, or `8080` in the above examples.) ```bash docker run -p : diff --git a/src/content/docs/en/reference/cli-reference.mdx b/src/content/docs/en/reference/cli-reference.mdx index 146982a266b6f..df3c887d90a10 100644 --- a/src/content/docs/en/reference/cli-reference.mdx +++ b/src/content/docs/en/reference/cli-reference.mdx @@ -200,7 +200,7 @@ Use these flags to customize the behavior of the Astro dev server. For flags sha #### `--port ` -Specifies which port to run on. Defaults to `3000`. +Specifies which port to run on. Defaults to `4321`. #### `--host [optional host address]` diff --git a/src/content/docs/en/tutorial/1-setup/2.mdx b/src/content/docs/en/tutorial/1-setup/2.mdx index c6b210851a4e4..43a8caff4893a 100644 --- a/src/content/docs/en/tutorial/1-setup/2.mdx +++ b/src/content/docs/en/tutorial/1-setup/2.mdx @@ -120,7 +120,7 @@ Your project files contain all the code necessary to display an Astro website, b 1. Click on the `localhost` link in your terminal window to see a live preview of your new Astro website! - (Astro uses `http://localhost:3000` by default if port 3000 is available.) + (Astro uses `http://localhost:4322` by default if port `4321` is available.) Here's what the Astro "Empty Project" starter website should look like in the browser preview: diff --git a/src/content/docs/en/tutorial/2-pages/1.mdx b/src/content/docs/en/tutorial/2-pages/1.mdx index 38bc26b04b7e7..9c416d298fb87 100644 --- a/src/content/docs/en/tutorial/2-pages/1.mdx +++ b/src/content/docs/en/tutorial/2-pages/1.mdx @@ -32,7 +32,7 @@ Now that you know that `.astro` files are responsible for pages on your website, Your editor might show a solid white circle on the tab label for this file. This means that the file is not yet saved. Under the File menu in VS Code, enable "Auto Save" and you should no longer need to save any files manually. ::: -4. Add `/about` to the end of your website preview's URL in the address bar and check that you can see a page load there. (e.g. `http://localhost:3000/about`) +4. Add `/about` to the end of your website preview's URL in the address bar and check that you can see a page load there. (e.g. `http://localhost:4321/about`) Right now, your "About" page should look exactly the same as the first page, but we're going to change that! diff --git a/src/content/docs/en/tutorial/2-pages/2.mdx b/src/content/docs/en/tutorial/2-pages/2.mdx index 9dc6ff717519b..010a5f79d55d7 100644 --- a/src/content/docs/en/tutorial/2-pages/2.mdx +++ b/src/content/docs/en/tutorial/2-pages/2.mdx @@ -30,7 +30,7 @@ Now that you have built pages using `.astro` files, let's make some blog posts u 2. Add a new (empty) file `post-1.md` inside your new `/posts/` folder. -3. Look for this page in your browser preview by adding `/posts/post-1` to the end of your existing preview URL. (e.g. `localhost:3000/posts/post-1`) +3. Look for this page in your browser preview by adding `/posts/post-1` to the end of your existing preview URL. (e.g. `http://localhost:4321/posts/post-1`) 4. Change the browser preview URL to view `/posts/post-2` instead. (This is a page you have not yet created.) @@ -70,7 +70,7 @@ Now that you have built pages using `.astro` files, let's make some blog posts u I will finish the Astro tutorial, and then keep adding more posts. Watch this space for more to come. ``` -2. Check your browser preview again at `localhost:3000/posts/post-1`. You should now see content on this page. +2. Check your browser preview again at `http://localhost:4321/posts/post-1`. You should now see content on this page. 3. Use your browser's Dev Tools to inspect this page. Notice that although you have not typed any HTML elements, your Markdown has been converted to HTML. You can see elements such as headings, paragraphs, and list items. diff --git a/src/content/docs/en/tutorial/4-layouts/2.mdx b/src/content/docs/en/tutorial/4-layouts/2.mdx index c3c6714b59e57..fd6aadb8bc8ef 100644 --- a/src/content/docs/en/tutorial/4-layouts/2.mdx +++ b/src/content/docs/en/tutorial/4-layouts/2.mdx @@ -55,7 +55,7 @@ When you include the `layout` frontmatter property in an `.md` file, all of your --- ``` -4. Check your browser preview again at `localhost:3000/posts/post-1` and notice what the layout has added to your page. +4. Check your browser preview again at `http://localhost:4321/posts/post-1` and notice what the layout has added to your page. 5. Add the same layout property to your two other blog posts `post-2.md` and `post-3.md`. Verify in your browser that your layout is also applied to these posts. diff --git a/src/content/docs/en/tutorial/4-layouts/3.mdx b/src/content/docs/en/tutorial/4-layouts/3.mdx index 273013338a3a3..3d4f6061f8b9c 100644 --- a/src/content/docs/en/tutorial/4-layouts/3.mdx +++ b/src/content/docs/en/tutorial/4-layouts/3.mdx @@ -45,7 +45,7 @@ You already have a `BaseLayout.astro` for defining the overall layout of your pa ``` -2. Check your browser preview at `localhost:3000/posts/post-1`. Now you should see content rendered by: +2. Check your browser preview at `http://localhost:4321/posts/post-1`. Now you should see content rendered by: - Your **main page layout**, including your styles, navigation links, and social footer. - Your **blog post layout**, including frontmatter properties like the description, date, title, and image @@ -66,7 +66,7 @@ You already have a `BaseLayout.astro` for defining the overall layout of your pa ``` -5. Check your browser preview again at `localhost:3000/posts/post-1` and verify that this line is no longer displayed and that your title is only displayed once. Make any other adjustments necessary to ensure that you do not have any duplicated content. +5. Check your browser preview again at `http://localhost:4321/posts/post-1` and verify that this line is no longer displayed and that your title is only displayed once. Make any other adjustments necessary to ensure that you do not have any duplicated content. Make sure that: diff --git a/src/content/docs/en/tutorial/5-astro-api/1.mdx b/src/content/docs/en/tutorial/5-astro-api/1.mdx index b30b394113064..ccb08ad05fc71 100644 --- a/src/content/docs/en/tutorial/5-astro-api/1.mdx +++ b/src/content/docs/en/tutorial/5-astro-api/1.mdx @@ -82,7 +82,7 @@ Now that you have a few blog posts to link to, let's configure the Blog page to This post should show up with my other blog posts, because `Astro.glob()` is returning a list of all my posts in order to create my list. ``` -4. Revisit your blog page in your browser preview at `localhost:3000/blog` and look for an updated list with four items, including your new blog post! +4. Revisit your blog page in your browser preview at `http://localhost:4321/blog` and look for an updated list with four items, including your new blog post! diff --git a/src/content/docs/en/tutorial/5-astro-api/2.mdx b/src/content/docs/en/tutorial/5-astro-api/2.mdx index e051675e0fcb4..f820085869e17 100644 --- a/src/content/docs/en/tutorial/5-astro-api/2.mdx +++ b/src/content/docs/en/tutorial/5-astro-api/2.mdx @@ -55,7 +55,7 @@ You can create entire sets of pages dynamically using `.astro` files that export 3. Make sure that every blog post contains at least one tag, written as an array, e.g. `tags: ["blogging"]`. -4. Visit `localhost:3000/tags/astro` in your browser preview and you should see a page, generated dynamically from `[tag].astro`. Check that you also have pages created for each of your tags at `/tags/successes`, `/tags/community`, and `/tags/learning%20in%20public`, etc., or at each of your custom tags. You may need to first quit and restart the dev server to see these new pages. +4. Visit `http://localhost:4321/tags/astro` in your browser preview and you should see a page, generated dynamically from `[tag].astro`. Check that you also have pages created for each of your tags at `/tags/successes`, `/tags/community`, and `/tags/learning%20in%20public`, etc., or at each of your custom tags. You may need to first quit and restart the dev server to see these new pages. ## Use props in dynamic routes @@ -268,7 +268,7 @@ const { posts } = Astro.props; Now, you should be able to visit any of your tag pages in your browser preview. -Navigate to `localhost:3000/tags/community` and you should see a list of only your blog posts with the tag `community`. Similarly `localhost:3000/tags/learning%20in%20public` should display a list of the blog posts tagged `learning in public`. +Navigate to `http://localhost:4321/tags/community` and you should see a list of only your blog posts with the tag `community`. Similarly `http://localhost:4321/tags/learning%20in%20public` should display a list of the blog posts tagged `learning in public`. In the next section, you will create navigation links to these pages. diff --git a/src/content/docs/en/tutorial/5-astro-api/3.mdx b/src/content/docs/en/tutorial/5-astro-api/3.mdx index 5752df8e371dd..0d1550567d63b 100644 --- a/src/content/docs/en/tutorial/5-astro-api/3.mdx +++ b/src/content/docs/en/tutorial/5-astro-api/3.mdx @@ -34,7 +34,7 @@ But, since you already have the directory `/tags/`, you can take advantage of an 1. Create a new file `index.astro` in the directory `src/pages/tags/`. -2. Navigate to `localhost:3000/tags` and verify that your site now contains a page at this URL. It will be empty, but it will exist. +2. Navigate to `http://localhost:4321/tags` and verify that your site now contains a page at this URL. It will be empty, but it will exist. 3. Create a minimal page at `src/pages/tags/index.astro` that uses your layout. You have done this before! @@ -196,7 +196,7 @@ Instead of creating items in an unordered list this time, create one `

` for e ``` -3. Check your browser preview at `localhost:3000/tags` to verify that you have some new styles and that each of the tags on the page has a working link to its own individual tag page. +3. Check your browser preview at `http://localhost:4321/tags` to verify that you have some new styles and that each of the tags on the page has a working link to its own individual tag page. ### Code Check-In @@ -239,7 +239,7 @@ const pageTitle = "Tag Index"; ## Add this page to your navigation -Right now, you can navigate to `localhost:3000/tags` and see this page. From this page, you can click on links to your individual tag pages. +Right now, you can navigate to `http://localhost:4321/tags` and see this page. From this page, you can click on links to your individual tag pages. But, you still need to make these pages discoverable from other pages on your website. diff --git a/src/content/docs/en/tutorial/5-astro-api/4.mdx b/src/content/docs/en/tutorial/5-astro-api/4.mdx index ffea42e081416..c3d1e41f5f2f7 100644 --- a/src/content/docs/en/tutorial/5-astro-api/4.mdx +++ b/src/content/docs/en/tutorial/5-astro-api/4.mdx @@ -115,7 +115,7 @@ Individuals can subscribe to your feed in a feed reader, and receive a notificat -4. Visit `localhost:3000/rss.xml` and verify that you can see (unformatted) text on the page with an `item` for each of your `.md` files. Each item should contain blog post information such as `title`, `url`, and `description`. +4. Visit `http://localhost:4321/rss.xml` and verify that you can see (unformatted) text on the page with an `item` for each of your `.md` files. Each item should contain blog post information such as `title`, `url`, and `description`. :::tip[view your rss feed in a reader] Download a feed reader, or sign up for an online feed reader service and subscribe to your site by adding your own Netlify URL. You can also share this link with others so they can subscribe to your posts, and be notified when a new one is published. diff --git a/src/content/docs/en/tutorial/6-islands/2.mdx b/src/content/docs/en/tutorial/6-islands/2.mdx index bedddf25c715b..2bea18e66d51d 100644 --- a/src/content/docs/en/tutorial/6-islands/2.mdx +++ b/src/content/docs/en/tutorial/6-islands/2.mdx @@ -68,7 +68,7 @@ Let's build a clickable icon to let your users toggle between light or dark mode ``` -3. Visit your browser preview at `localhost:3000` to see the icon now on all your pages. You can try clicking it, but you have not written a script to make it interactive yet. +3. Visit your browser preview at `http://localhost:4321` to see the icon now on all your pages. You can try clicking it, but you have not written a script to make it interactive yet. ## Add CSS styling for a dark theme @@ -133,7 +133,7 @@ To add interactivity to an Astro component, you can use a ` ``` -2. Check your browser preview at `localhost:3000` and click the theme icon. Verify that you can change between light and dark modes. +2. Check your browser preview at `http://localhost:4321` and click the theme icon. Verify that you can change between light and dark modes. diff --git a/src/content/docs/es/guides/cms/contentful.mdx b/src/content/docs/es/guides/cms/contentful.mdx index 0170918336e90..ac7f0153675a6 100644 --- a/src/content/docs/es/guides/cms/contentful.mdx +++ b/src/content/docs/es/guides/cms/contentful.mdx @@ -426,7 +426,7 @@ const { content, title, date } = Astro.props; ``` -Navega a http://localhost:3000/ y haz clic en uno de tus artículos para asegurarte de que tu ruta dinámica esté funcionando. +Navega a http://localhost:4321/ y haz clic en uno de tus artículos para asegurarte de que tu ruta dinámica esté funcionando. #### Renderizado del lado del servidor diff --git a/src/content/docs/es/guides/cms/kontent-ai.mdx b/src/content/docs/es/guides/cms/kontent-ai.mdx index f8b527eb5653e..d41f8fc310d82 100644 --- a/src/content/docs/es/guides/cms/kontent-ai.mdx +++ b/src/content/docs/es/guides/cms/kontent-ai.mdx @@ -441,7 +441,7 @@ const blogPost: BlogPost = Astro.props.blogPost ``` -Navega a tu vista previa de Astro (http://localhost:3000/blog/astro-is-amazing/ de forma predeterminada) para ver la entrada de blog renderizada. +Navega a tu vista previa de Astro (http://localhost:4321/blog/astro-is-amazing/ de forma predeterminada) para ver la entrada de blog renderizada. #### Renderizado del lado del servidor diff --git a/src/content/docs/es/guides/cms/payload.mdx b/src/content/docs/es/guides/cms/payload.mdx index 6ecd32b6e1a28..55b3deb48b069 100644 --- a/src/content/docs/es/guides/cms/payload.mdx +++ b/src/content/docs/es/guides/cms/payload.mdx @@ -73,7 +73,7 @@ import Users from "./collections/Users"; import Posts from "./collections/Posts"; export default buildConfig({ - serverURL: "http://localhost:3000", + serverURL: "http://localhost:4321", admin: { user: Users.slug, }, @@ -91,7 +91,7 @@ Esto hará que aparezca una nueva colección llamada "Posts" en tu panel de cont 2. Ingresa a la colección "Posts" y crea una nueva publicación. Después de guardarla, notarás que la URL de la API aparece en la esquina inferior derecha. -3. Con el servidor de desarrollo en ejecución, abre `http://localhost:3000/api/posts` en tu navegador. Deberías ver un archivo JSON que contiene la publicación que has creado como un objeto. +3. Con el servidor de desarrollo en ejecución, abre `http://localhost:4321/api/posts` en tu navegador. Deberías ver un archivo JSON que contiene la publicación que has creado como un objeto. ```json { @@ -118,7 +118,7 @@ Esto hará que aparezca una nueva colección llamada "Posts" en tu panel de cont ``` :::tip -Por defecto, tanto Astro como PayloadCMS utilizarán el puerto 3000. Es posible que desees cambiar el puerto de PayloadCMS en el archivo `src/server.ts`. No olvides actualizar el `serverURL` en `src/payload.config.ts` también. +Por defecto, tanto Astro como PayloadCMS utilizarán el puerto 4321. Es posible que desees cambiar el puerto de PayloadCMS en el archivo `src/server.ts`. No olvides actualizar el `serverURL` en `src/payload.config.ts` también. ::: ### Obteniendo los datos @@ -133,7 +133,7 @@ Por ejemplo, para mostrar una lista de títulos de publicaciones y su contenido: --- import HomeLayout from "../layouts/HomeLayout.astro"; -const res = await fetch("https://localhost:5000/api/posts") // https://localhost:3000/api/posts by default +const res = await fetch("http://localhost:5000/api/posts") // http://localhost:4321/api/posts by default const posts = await res.json() --- @@ -161,7 +161,7 @@ La búsqueda a través de la API devuelve un arreglo de objetos (publicaciones) --- import HomeLayout from "../layouts/HomeLayout.astro"; -const res = await fetch("http://localhost:5000/api/posts") // https://localhost:3000/api/posts by default +const res = await fetch("http://localhost:5000/api/posts") // http://localhost:4321/api/posts by default const posts = await res.json() --- diff --git a/src/content/docs/es/guides/testing.mdx b/src/content/docs/es/guides/testing.mdx index 5dd2793c92211..51d3f76023a20 100644 --- a/src/content/docs/es/guides/testing.mdx +++ b/src/content/docs/es/guides/testing.mdx @@ -79,14 +79,14 @@ export default defineConfig({ ```js title="cypress/e2e/index.cy.ts" it('los titulos son correctos', () => { - const page = cy.visit('http://localhost:3000'); + const page = cy.visit('http://localhost:4321'); page.get('title').should('have.text', '¡Astro es increíble!') page.get('h1').should('have.text', 'Hola mundo desde Astro'); }); ``` :::tip[establecer una url base] - Puedes establecer [`"baseUrl": "http://localhost:3000"`](https://docs.cypress.io/guides/end-to-end-testing/testing-your-app#Step-3-Configure-Cypress) en el archivo de configuración `cypress.config.ts` para usar `cy.visit("/")` en lugar de `cy.visit("http://localhost:3000/")` para una URL más conveniente. + Puedes establecer [`"baseUrl": "http://localhost:4321"`](https://docs.cypress.io/guides/end-to-end-testing/testing-your-app#Step-3-Configure-Cypress) en el archivo de configuración `cypress.config.ts` para usar `cy.visit("/")` en lugar de `cy.visit("http://localhost:4321/")` para una URL más conveniente. ::: ### Ejecutando tus tests de Cypress @@ -187,14 +187,14 @@ Alternativamente, puedes instalar Playwright dentro de tu proyecto de Astro usan import { test, expect } from '@playwright/test'; test('el titulo es correcto', async ({ page }) => { - await page.goto("http://localhost:3000/"); + await page.goto("http://localhost:4321/"); await expect(page).toHaveTitle('¡Astro es increíble!'); }); ``` :::tip[Establecer una url base] - Puedes establecer [`"baseURL": "http://localhost:3000"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) en el archivo de configuración `playwright.config.ts` para usar `page.goto("/")` en lugar de `page.goto("http://localhost:3000/")` para una URL más conveniente. + Puedes establecer [`"baseURL": "http://localhost:4321"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) en el archivo de configuración `playwright.config.ts` para usar `page.goto("/")` en lugar de `page.goto("http://localhost:4321/")` para una URL más conveniente. ::: ### Ejecutar los tests con Playwright @@ -232,12 +232,12 @@ import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { webServer: { command: 'npm run preview', - url: 'http://localhost:3000/', + url: 'http://localhost:4321/', timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, use: { - baseURL: 'http://localhost:3000/', + baseURL: 'http://localhost:4321/', }, }; export default config; diff --git a/src/content/docs/es/install/auto.mdx b/src/content/docs/es/install/auto.mdx index 8bd42e2ef24ff..78035023d1ffb 100644 --- a/src/content/docs/es/install/auto.mdx +++ b/src/content/docs/es/install/auto.mdx @@ -80,7 +80,7 @@ Cada plantilla de inicio posee un script preconfigurado que ejecutará `astro de -¡Si todo marcha bien, Astro deberá servir tu proyecto localmente en [http://localhost:3000](http://localhost:3000)! +¡Si todo marcha bien, Astro deberá servir tu proyecto localmente en [http://localhost:4321](http://localhost:4321)! Astro escuchará cualquier cambio en la carpeta `src/` y actualizará automáticamente tu proyecto. De esta forma, no será necesario reiniciar el servidor local durante el desarrollo. diff --git a/src/content/docs/es/recipes/docker.mdx b/src/content/docs/es/recipes/docker.mdx index 3a96e9df99023..84cc043ffdd1d 100644 --- a/src/content/docs/es/recipes/docker.mdx +++ b/src/content/docs/es/recipes/docker.mdx @@ -22,7 +22,7 @@ Si estás usando otro gestor de paquetes que no sea npm, deberás ajustar los co ### SSR -Este Dockerfile construirá tu sitio y lo servirá utilizando Node.js en el puerto `3000`, por lo tanto, requiere tener instalado el [adaptador de Node](/es/guides/integrations-guide/node/) en tu proyecto de Astro. +Este Dockerfile construirá tu sitio y lo servirá utilizando Node.js en el puerto `4321`, por lo tanto, requiere tener instalado el [adaptador de Node](/es/guides/integrations-guide/node/) en tu proyecto de Astro. ```docker title="Dockerfile" FROM node:lts AS runtime @@ -34,8 +34,8 @@ RUN npm install RUN npm run build ENV HOST=0.0.0.0 -ENV PORT=3000 -EXPOSE 3000 +ENV PORT=4321 +EXPOSE 4321 CMD node ./dist/server/entry.mjs ``` @@ -149,8 +149,8 @@ FROM base AS runtime COPY --from=prod-deps /app/node_modules ./node_modules COPY --from=build /app/dist ./dist ENV HOST=0.0.0.0 -ENV PORT=3000 -EXPOSE 3000 +ENV PORT=4321 +EXPOSE 4321 CMD node ./dist/server/entry.mjs ``` @@ -166,7 +166,7 @@ Esto generará una imagen que podrás ejecutar localmente o implementar en una p 2. Para ejecutar tu imagen como un contenedor local, utiliza el siguiente comando. -Reemplaza `` con un puerto abierto en tu máquina. Reemplaza `` con el puerto expuesto por tu contenedor Docker (`3000`, `80` o `8080` en los ejemplos anteriores). +Reemplaza `` con un puerto abierto en tu máquina. Reemplaza `` con el puerto expuesto por tu contenedor Docker (`4321`, `80` o `8080` en los ejemplos anteriores). ```bash docker run -p : diff --git a/src/content/docs/es/reference/cli-reference.mdx b/src/content/docs/es/reference/cli-reference.mdx index 7c314d1c35b3b..20f3bf7a219ec 100644 --- a/src/content/docs/es/reference/cli-reference.mdx +++ b/src/content/docs/es/reference/cli-reference.mdx @@ -192,7 +192,7 @@ Usa estas flags para personalizar el comportamiento del servidor de desarrollo d #### `--port ` -Especifica en qué puerto se ejecuta el servidor. El valor predeterminado es `3000`. +Especifica en qué puerto se ejecuta el servidor. El valor predeterminado es `4321`. #### `--host [dirección de host opcional]` diff --git a/src/content/docs/es/tutorial/1-setup/2.mdx b/src/content/docs/es/tutorial/1-setup/2.mdx index 10853eabc9452..c4780203ab736 100644 --- a/src/content/docs/es/tutorial/1-setup/2.mdx +++ b/src/content/docs/es/tutorial/1-setup/2.mdx @@ -119,7 +119,7 @@ Tus archivos de proyecto contienen todo el código necesario para mostrar un sit 1. Haz clic en el enlace `localhost` en la terminal para ver una vista previa en directo de tu nuevo sitio web Astro. - (Astro utiliza `http://localhost:3000` por defecto si el puerto 3000 está disponible). + (Astro utiliza `http://localhost:4322` por defecto si el puerto `4321` está disponible). Este es el aspecto que debería tener el sitio web de inicio del "Proyecto vacío" de Astro en la vista previa del navegador: diff --git a/src/content/docs/es/tutorial/2-pages/1.mdx b/src/content/docs/es/tutorial/2-pages/1.mdx index 7b2aa5abe6e10..aaa2916fdceb0 100644 --- a/src/content/docs/es/tutorial/2-pages/1.mdx +++ b/src/content/docs/es/tutorial/2-pages/1.mdx @@ -32,7 +32,7 @@ Ahora que ya sabes que los archivos `.astro` son los responsables de las página Tu editor puede mostrar un círculo blanco sólido en la etiqueta de este archivo. Esto significa que el archivo aún no se ha guardado. En el menú Archivo de VS Code, activa la opción "Guardar automáticamente" y ya no tendrás que guardar ningún archivo manualmente. ::: -4. Añade `/about` al final de la URL de la vista previa de tu sitio web en la barra de direcciones y compruebe que puede ver una página cargada allí. (por ejemplo, `http://localhost:3000/about`) +4. Añade `/about` al final de la URL de la vista previa de tu sitio web en la barra de direcciones y compruebe que puede ver una página cargada allí. (por ejemplo, `http://localhost:4321/about`) Ahora mismo, tu página "Acerca de" debería tener exactamente el mismo aspecto que la primera página, pero vamos a cambiarlo. diff --git a/src/content/docs/es/tutorial/2-pages/2.mdx b/src/content/docs/es/tutorial/2-pages/2.mdx index d61ab57847276..3d414f1eb56e6 100644 --- a/src/content/docs/es/tutorial/2-pages/2.mdx +++ b/src/content/docs/es/tutorial/2-pages/2.mdx @@ -30,7 +30,7 @@ Ahora que ya has creado páginas con archivos `.astro`, vamos a crear algunos po 2. Añade un nuevo fichero (vacío) `post-1.md` dentro de tu nueva carpeta `/posts/`. -3. Busca esta página en la vista previa de tu navegador añadiendo `/posts/post-1` al final de tu URL de vista previa. (por ejemplo, `localhost:3000/posts/post-1`) +3. Busca esta página en la vista previa de tu navegador añadiendo `/posts/post-1` al final de tu URL de vista previa. (por ejemplo, `http://localhost:4321/posts/post-1`) 4. Cambia la URL de vista previa del navegador para ver `/posts/post-2` en tu lugar. (Se trata de una página que aún no ha sido creada). @@ -70,7 +70,7 @@ Ahora que ya has creado páginas con archivos `.astro`, vamos a crear algunos po Terminaré el tutorial de Astro, y luego seguiré añadiendo más posts. Mira este espacio para más por venir. ``` -2. Comprueba de nuevo la vista previa de tu navegador en `localhost:3000/posts/post-1`. Ahora deberías ver el contenido de esta página. +2. Comprueba de nuevo la vista previa de tu navegador en `http://localhost:4321/posts/post-1`. Ahora deberías ver el contenido de esta página. 3. Utiliza las herramientas de desarrollo de tu navegador para inspeccionar esta página. Observa que, aunque no has escrito ningún elemento HTML, tu Markdown se ha convertido a HTML. Puedes ver elementos como encabezados, párrafos y elementos de lista. diff --git a/src/content/docs/es/tutorial/4-layouts/2.mdx b/src/content/docs/es/tutorial/4-layouts/2.mdx index 10167b7904431..25c687a8a6fb1 100644 --- a/src/content/docs/es/tutorial/4-layouts/2.mdx +++ b/src/content/docs/es/tutorial/4-layouts/2.mdx @@ -55,7 +55,7 @@ Al incluir la propiedad frontmatter `layout` en un archivo `.md`, todos los valo --- ``` -4. Comprueba de nuevo la vista previa de tu navegador en `localhost:3000/posts/post-1` y observa lo que la plantilla ha añadido a tu página. +4. Comprueba de nuevo la vista previa de tu navegador en `http://localhost:4321/posts/post-1` y observa lo que la plantilla ha añadido a su página. 5. Añade la misma propiedad plantilla a tus otros dos post `post-2.md` y `post-3.md`. Comprueba en tu navegador que el plantilla también se aplica a estos post. diff --git a/src/content/docs/es/tutorial/4-layouts/3.mdx b/src/content/docs/es/tutorial/4-layouts/3.mdx index ec051eb345995..8a883085fb1ae 100644 --- a/src/content/docs/es/tutorial/4-layouts/3.mdx +++ b/src/content/docs/es/tutorial/4-layouts/3.mdx @@ -45,7 +45,7 @@ El `MarkdownPostLayout.astro` te proporciona algunas plantillas adicionales para ``` -2. Comprueba la vista previa de tu navegador en `localhost:3000/posts/post-1`. Ahora debería ver el contenido renderizado por: +2. Comprueba la vista previa de tu navegador en `http://localhost:4321/posts/post-1`. Ahora debería ver el contenido renderizado por: - Tu ** plantilla de página principal**, incluyendo tus estilos, enlaces de navegación y pie de página social. - Tu **plantilla de blog post**, incluyendo propiedades frontmatter como la descripción, fecha, título e imagen. @@ -66,7 +66,7 @@ El `MarkdownPostLayout.astro` te proporciona algunas plantillas adicionales para ``` -5. Comprueba de nuevo la vista previa de tu navegador en `localhost:3000/posts/post-1` y verifica que esta línea ya no aparece y que su título sólo se muestra una vez. Realice cualquier otro ajuste necesario para asegurarse de que no tiene contenido duplicado. +5. Comprueba de nuevo la vista previa de tu navegador en `http://localhost:4321/posts/post-1` y verifica que esta línea ya no aparece y que su título sólo se muestra una vez. Realice cualquier otro ajuste necesario para asegurarse de que no tiene contenido duplicado. Asegúrese de que: diff --git a/src/content/docs/es/tutorial/5-astro-api/1.mdx b/src/content/docs/es/tutorial/5-astro-api/1.mdx index 2d6cc574c2896..cc024a129ae10 100644 --- a/src/content/docs/es/tutorial/5-astro-api/1.mdx +++ b/src/content/docs/es/tutorial/5-astro-api/1.mdx @@ -82,7 +82,7 @@ Ahora que ya tienes unas cuantas entradas de blog a las que enlazar, vamos a con Esta entrada debería aparecer con las demás entradas de mi blog, porque `Astro.glob()` está devolviendo una lista de todas mis entradas para crear mi lista. ``` -4. Vuelve a visitar la página de tu blog en la vista previa de tu navegador en `localhost:3000/blog` y busca una lista actualizada con cuatro elementos, incluida tu nueva entrada de blog +4. Vuelve a visitar la página de tu blog en la vista previa de tu navegador en `http://localhost:4321/blog` y busca una lista actualizada con cuatro elementos, incluida tu nueva entrada de blog diff --git a/src/content/docs/es/tutorial/5-astro-api/2.mdx b/src/content/docs/es/tutorial/5-astro-api/2.mdx index f998db1c33459..f39d5b200b2c5 100644 --- a/src/content/docs/es/tutorial/5-astro-api/2.mdx +++ b/src/content/docs/es/tutorial/5-astro-api/2.mdx @@ -55,7 +55,7 @@ Puedes crear conjuntos completos de páginas de forma dinámica utilizando archi 3. Asegúrate de que cada entrada del blog contiene al menos una etiqueta, escrita como un array, por ejemplo `tags: ["bloguear"]`. -4. Visita `localhost:3000/tags/astro` en la vista previa de tu navegador y deberías ver una página, generada dinámicamente a partir de `[tag].astro`. Comprueba que también tienes páginas creadas para cada una de tus etiquetas en `/tags/éxitos`, `/tags/comunidad`, y `/tags/aprender%20en%20publico`, etc., o en cada una de tus etiquetas personalizadas. Es posible que primero tengas que salir y reiniciar el servidor de desarrollo para ver estas nuevas páginas. +4. Visita `http://localhost:4321/tags/astro` en la vista previa de tu navegador y deberías ver una página, generada dinámicamente a partir de `[tag].astro`. Comprueba que también tienes páginas creadas para cada una de tus etiquetas en `/tags/éxitos`, `/tags/comunidad`, y `/tags/aprender%20en%20publico`, etc., o en cada una de tus etiquetas personalizadas. Es posible que primero tengas que salir y reiniciar el servidor de desarrollo para ver estas nuevas páginas. ## Utilizar props en rutas dinámicas @@ -269,7 +269,7 @@ const { posts } = Astro.props; Ahora, deberías poder visitar cualquiera de tus páginas de etiquetas en la vista previa de tu navegador. -Navega a `localhost:3000/tags/community` y verás una lista sólo de las entradas de tu blog con la etiqueta `comunidad`. Del mismo modo, `localhost:3000/tags/learn%20in%20public` debería mostrar una lista de las entradas del blog con la etiqueta `aprender en público`. +Navega a `http://localhost:4321/tags/community` y verás una lista sólo de las entradas de tu blog con la etiqueta `comunidad`. Del mismo modo, `http://localhost:4321/tags/learn%20in%20public` debería mostrar una lista de las entradas del blog con la etiqueta `aprender en público`. En la siguiente sección, crearás enlaces de navegación a estas páginas. diff --git a/src/content/docs/es/tutorial/5-astro-api/3.mdx b/src/content/docs/es/tutorial/5-astro-api/3.mdx index ae020f19d33d1..313c2dde96291 100644 --- a/src/content/docs/es/tutorial/5-astro-api/3.mdx +++ b/src/content/docs/es/tutorial/5-astro-api/3.mdx @@ -34,7 +34,7 @@ Pero, como ya tienes el directorio `/tags/`, puedes aprovechar otro patrón de e 1. Crea un nuevo fichero `index.astro` en el directorio `src/pages/tags/`. -2. Vaya a `localhost:3000/tags` y compruebe que su sitio contiene ahora una página en esta URL. Estará vacía, pero existirá. +2. Vaya a `http://localhost:4321/tags` y compruebe que su sitio contiene ahora una página en esta URL. Estará vacía, pero existirá. 3. Crea una página mínima en `src/pages/tags/index.astro` que utilice tu diseño. Esto ya lo has hecho antes. @@ -196,7 +196,7 @@ En lugar de crear elementos en una lista desordenada esta vez, crea un `

` par ``` -3. Comprueba la vista previa de tu navegador en `localhost:3000/tags` para verificar que tienes algunos estilos nuevos y que cada una de las etiquetas de la página tiene un enlace que funciona a su propia página de etiquetas individual. +3. Comprueba la vista previa de tu navegador en `http://localhost:4321/tags` para verificar que tienes algunos estilos nuevos y que cada una de las etiquetas de la página tiene un enlace que funciona a su propia página de etiquetas individual. ### Registro de códigos @@ -240,7 +240,7 @@ const pageTitle = "Tag Index"; ## Añade esta página a tu navegación -En este momento, puedes navegar a `localhost:3000/tags` y ver esta página. Desde esta página, puedes hacer clic en los enlaces a sus páginas de etiquetas individuales. +En este momento, puedes navegar a `http://localhost:4321/tags` y ver esta página. Desde esta página, puedes hacer clic en los enlaces a sus páginas de etiquetas individuales. Pero aún así, debes hacer que estas páginas se puedan descubrir desde otras páginas de tu sitio web. diff --git a/src/content/docs/es/tutorial/5-astro-api/4.mdx b/src/content/docs/es/tutorial/5-astro-api/4.mdx index 8c0dfe10f1efc..529a29decc36a 100644 --- a/src/content/docs/es/tutorial/5-astro-api/4.mdx +++ b/src/content/docs/es/tutorial/5-astro-api/4.mdx @@ -115,7 +115,7 @@ Las personas pueden suscribirse a tu feed en un lector de feeds y recibir una no -4. Visita `localhost:3000/rss.xml` y comprueba que puedes ver texto (sin formato) en la página con un `item` para cada uno de tus archivos `.md`. Cada elemento debe contener información sobre la entrada del blog, como `title`, `url` y `description`. +4. Visita `http://localhost:4321/rss.xml` y comprueba que puedes ver texto (sin formato) en la página con un `item` para cada uno de tus archivos `.md`. Cada elemento debe contener información sobre la entrada del blog, como `title`, `url` y `description`. :::tip[ver tu feed rss en un lector] Descarga un lector de feeds, o regístrate en un servicio de lector de feeds online y suscríbete a tu sitio añadiendo tu propia URL de Netlify. También puedes compartir este enlace con otras personas para que puedan suscribirse a tus entradas y recibir una notificación cuando se publique una nueva. diff --git a/src/content/docs/es/tutorial/6-islands/2.mdx b/src/content/docs/es/tutorial/6-islands/2.mdx index 3c44d9f180ba6..e2b60031ea997 100644 --- a/src/content/docs/es/tutorial/6-islands/2.mdx +++ b/src/content/docs/es/tutorial/6-islands/2.mdx @@ -68,7 +68,7 @@ Vamos a crear un icono en el que se pueda hacer clic para que los usuarios pueda ``` -3. Visita la vista previa de tu navegador en `localhost:3000` para ver el icono ahora en todas tus páginas. Puedes intentar hacer clic en él, pero aún no has escrito un script para hacerlo interactivo. +3. Visita la vista previa de tu navegador en `http://localhost:4321` para ver el icono ahora en todas tus páginas. Puedes intentar hacer clic en él, pero aún no has escrito un script para hacerlo interactivo. ## Añadir estilos CSS para un tema oscuro @@ -133,7 +133,7 @@ Para añadir interactividad a un componente de Astro, puedes utilizar una etique ``` -2. Comprueba la vista previa de tu navegador en `localhost:3000` y haz clic en el icono del tema. Comprueba que puedes cambiar entre los modos claro y oscuro. +2. Comprueba la vista previa de tu navegador en `http://localhost:4321` y haz clic en el icono del tema. Comprueba que puedes cambiar entre los modos claro y oscuro. diff --git a/src/content/docs/fr/guides/testing.mdx b/src/content/docs/fr/guides/testing.mdx index a47c14e30082a..b549795c02408 100644 --- a/src/content/docs/fr/guides/testing.mdx +++ b/src/content/docs/fr/guides/testing.mdx @@ -66,14 +66,14 @@ Alternativement, vous pouvez aussi installer Playwright dans votre projet Astro import { test, expect } from '@playwright/test'; test('meta is correct', async ({ page }) => { - await page.goto("http://localhost:3000/"); + await page.goto("http://localhost:4321/"); await expect(page).toHaveTitle('Astro is awesome!'); }); ``` :::tip[Mettre un lien de base] -Pour un lien plus pratique, vous pouvez définir le [`"baseURL": "http://localhost:3000"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) dans le fichier de configuration `playwright.config.ts` pour pouvoir utiliser `page.goto("/")` au lieu de `page.goto("http://localhost:3000/")`. +Pour un lien plus pratique, vous pouvez définir le [`"baseURL": "http://localhost:4321"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) dans le fichier de configuration `playwright.config.ts` pour pouvoir utiliser `page.goto("/")` au lieu de `page.goto("http://localhost:4321/")`. ::: ### Exécuter vos tests Playwright @@ -110,12 +110,12 @@ import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { webServer: { command: 'yarn preview', - url: 'http://localhost:3000/app/', + url: 'http://localhost:4321/app/', timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, use: { - baseURL: 'http://localhost:3000/app/', + baseURL: 'http://localhost:4321/app/', }, }; export default config; diff --git a/src/content/docs/fr/install/auto.mdx b/src/content/docs/fr/install/auto.mdx index 68d00016f2088..e0be382796370 100644 --- a/src/content/docs/fr/install/auto.mdx +++ b/src/content/docs/fr/install/auto.mdx @@ -81,7 +81,7 @@ Chaque modèle de départ est livré avec un script préconfiguré qui exécuter -Si tout se passe comme prévu, Astro devrait maintenant être en train de faire tourner votre projet à l'addresse [http://localhost:3000/](http://localhost:3000/) ! +Si tout se passe comme prévu, Astro devrait maintenant être en train de faire tourner votre projet à l'addresse [http://localhost:4321/](http://localhost:4321/) ! Astro va également suivre les modifications de fichiers dans le répertoire `src/`, vous n'aurez donc pas besoin de redémarrer le serveur à chaque fois que vous apporterez des modifications au cours du développement. diff --git a/src/content/docs/fr/reference/cli-reference.mdx b/src/content/docs/fr/reference/cli-reference.mdx index af03fb9cc7057..c7936552393ae 100644 --- a/src/content/docs/fr/reference/cli-reference.mdx +++ b/src/content/docs/fr/reference/cli-reference.mdx @@ -198,7 +198,7 @@ Utilisez ces options pour personnaliser le comportement du serveur de développe #### `--port ` -Spécifie le port sur lequel se démarrer. Il est défini par défaut sur `3000`. +Spécifie le port sur lequel se démarrer. Il est défini par défaut sur `4321`. #### `--host [adresse IP facultative]` diff --git a/src/content/docs/fr/reference/configuration-reference.mdx b/src/content/docs/fr/reference/configuration-reference.mdx index 3956b3e2aec4a..b6bfef03a53ca 100644 --- a/src/content/docs/fr/reference/configuration-reference.mdx +++ b/src/content/docs/fr/reference/configuration-reference.mdx @@ -251,7 +251,7 @@ Pour définir une configuration différente basée sur la commande run ("dev", " ```js { // Exemple: Utiliser la syntaxe de fonction pour personnaliser le serveur en fonction de la commande - server: (command) => ({ port: command === 'dev' ? 3000 : 4000 }) + server: (command) => ({ port: command === 'dev' ? 4321 : 4000 }) } ``` @@ -275,7 +275,7 @@ Définir les adresses IP réseau sur lesquelles le serveur doit écouter (c.-à-

**Type:** `number`
-**Par défaut:** `3000` +**Par défaut:** `4321`

Définissez le port sur lequel le serveur doit écouter. diff --git a/src/content/docs/it/install/auto.mdx b/src/content/docs/it/install/auto.mdx index 29f0978608ac2..ed2dc9309420c 100644 --- a/src/content/docs/it/install/auto.mdx +++ b/src/content/docs/it/install/auto.mdx @@ -79,7 +79,7 @@ Ogni template ufficiale arriva con uno script preconfigurato che eseguirà il co -Se tutto va bene, ora Astro dovrebbe servire il tuo progetto all'indirizzo [http://localhost:3000/](http://localhost:3000/)! +Se tutto va bene, ora Astro dovrebbe servire il tuo progetto all'indirizzo [http://localhost:4321/](http://localhost:4321/)! Astro osserverà ogni cambiamento ai file nella cartella `src/`, perciò non dovrai far ripartire il server ad ogni modifica nel progetto durante lo sviluppo. diff --git a/src/content/docs/ja/guides/cms/contentful.mdx b/src/content/docs/ja/guides/cms/contentful.mdx index 6b31ad2942705..b09f79a15b077 100644 --- a/src/content/docs/ja/guides/cms/contentful.mdx +++ b/src/content/docs/ja/guides/cms/contentful.mdx @@ -419,7 +419,7 @@ const { content, title, date } = Astro.props; ``` -http://localhost:3000/posts/astro-is-amazing/にアクセスすると動的ルーティングが動作していることが分かります! +http://localhost:4321/posts/astro-is-amazing/にアクセスすると動的ルーティングが動作していることが分かります! #### サーバーサイドレンダリング diff --git a/src/content/docs/ja/guides/testing.mdx b/src/content/docs/ja/guides/testing.mdx index 091d344e4b0f0..1c3820765cd4e 100644 --- a/src/content/docs/ja/guides/testing.mdx +++ b/src/content/docs/ja/guides/testing.mdx @@ -64,14 +64,14 @@ Playwrightは、モダンなウェブアプリケーションのためのE2Eテ ```jsx title="src/test/index.spec.ts" "Astro最高!" test('メタ情報が正しい', async ({ page }) => { - await page.goto("http://localhost:3000/"); + await page.goto("http://localhost:4321/"); await expect(page).toHaveTitle('Astro最高!'); }); ``` :::tip[baseurlをセットする] -設定ファイル`playwright.config.ts`で[`"baseURL": "http://localhost:3000"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url)と設定すると、`page.goto("http://localhost:3000/")`の代わりに、より便利なURLとして`page.goto("/")`を使用できます。 +設定ファイル`playwright.config.ts`で[`"baseURL": "http://localhost:4321"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url)と設定すると、`page.goto("http://localhost:4321/")`の代わりに、より便利なURLとして`page.goto("/")`を使用できます。 ::: ### Playwrightのテストを実行する @@ -108,12 +108,12 @@ import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { webServer: { command: 'yarn preview', - url: 'http://localhost:3000/app/', + url: 'http://localhost:4321/app/', timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, use: { - baseURL: 'http://localhost:3000/app/', + baseURL: 'http://localhost:4321/app/', }, }; export default config; diff --git a/src/content/docs/ja/install/auto.mdx b/src/content/docs/ja/install/auto.mdx index 0b70b09881346..622dd3a6ff8a0 100644 --- a/src/content/docs/ja/install/auto.mdx +++ b/src/content/docs/ja/install/auto.mdx @@ -81,7 +81,7 @@ Astroには、プロジェクト開発に必要なものをすべて備えた開 -うまくいけば、Astroは[http://localhost:3000](http://localhost:3000)でプロジェクトの開発サーバーを起動します! +うまくいけば、Astroは[http://localhost:4321](http://localhost:4321)でプロジェクトの開発サーバーを起動します! Astroは `src/` ディレクトリのファイル変更を自動検出するので、開発中に変更を加えてもサーバーを再起動する必要はありません。 diff --git a/src/content/docs/ja/reference/cli-reference.mdx b/src/content/docs/ja/reference/cli-reference.mdx index bc01b15c1849f..9bff36e9c6ad6 100644 --- a/src/content/docs/ja/reference/cli-reference.mdx +++ b/src/content/docs/ja/reference/cli-reference.mdx @@ -64,7 +64,7 @@ Astro の開発サーバーの動作をカスタマイズするためにこれ #### `--port <ポート番号>` -どのポートで起動するかを指定します。デフォルト値は `3000` です。 +どのポートで起動するかを指定します。デフォルト値は `4321` です。 #### `--host [任意のホストのアドレス]` diff --git a/src/content/docs/ja/reference/configuration-reference.mdx b/src/content/docs/ja/reference/configuration-reference.mdx index 87c28fdd1267f..679c98d6d0797 100644 --- a/src/content/docs/ja/reference/configuration-reference.mdx +++ b/src/content/docs/ja/reference/configuration-reference.mdx @@ -200,7 +200,7 @@ Astro がサイトを読み込むディレクトリを設定します。 ```js { // 例: コマンドに応じてカスタマイズするためには関数の構文を使用します - server: (command) => ({ port: command === 'dev' ? 3000 : 4000 }) + server: (command) => ({ port: command === 'dev' ? 4321 : 4000 }) } ``` @@ -223,7 +223,7 @@ Astro がサイトを読み込むディレクトリを設定します。

**データ型:** `number`
-**デフォルト値:** `3000` +**デフォルト値:** `4321`

ポートがリッスンするポートを設定する。 diff --git a/src/content/docs/ja/tutorial/1-setup/2.mdx b/src/content/docs/ja/tutorial/1-setup/2.mdx index 4bcf8f420b324..31c402e358617 100644 --- a/src/content/docs/ja/tutorial/1-setup/2.mdx +++ b/src/content/docs/ja/tutorial/1-setup/2.mdx @@ -117,9 +117,9 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; プロジェクトファイルには、Astroウェブサイトを表示するために必要なすべてのコードが含まれていますが、コードをウェブページとして表示するのはブラウザの役割です。 -1. ターミナルウィンドウの`localhost`リンクをクリックして、新しいAstroウェブサイトのライブプレビューを確認します! +1. ターミナルウィンドウの`http://localhost`リンクをクリックして、新しいAstroウェブサイトのライブプレビューを確認します! - (Astroは、ポート3000が使用可能な場合、デフォルトで`http://localhost:3000`を使用します。) + (Astroは、ポート4321が使用可能な場合、デフォルトで`http://localhost:4321`を使用します。) Astroの「Empty Project」スターターウェブサイトは、ブラウザ上では以下のように表示されます。 diff --git a/src/content/docs/ja/tutorial/2-pages/1.mdx b/src/content/docs/ja/tutorial/2-pages/1.mdx index e1c17f32c6331..27a57ec1a3097 100644 --- a/src/content/docs/ja/tutorial/2-pages/1.mdx +++ b/src/content/docs/ja/tutorial/2-pages/1.mdx @@ -32,7 +32,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; エディタ上で、このファイルのタブラベルに白丸が表示される場合があります。これは、ファイルがまだ保存されていないことを意味します。VS Codeのファイルメニューで「自動保存」を有効にすると、ファイルを手動で保存する必要はなくなります。 ::: -4. `/about`をアドレスバーのURL末尾に追加し、ページがロードされることを確認します。(たとえば`http://localhost:3000/about`) +4. `/about`をアドレスバーのURL末尾に追加し、ページがロードされることを確認します。(たとえば`http://localhost:4321/about`) 現在、「概要」ページは最初のページとまったく同じに見えるはずですが、これを変更していきます! diff --git a/src/content/docs/ja/tutorial/2-pages/2.mdx b/src/content/docs/ja/tutorial/2-pages/2.mdx index cbf10848e13a2..7a224b4092978 100644 --- a/src/content/docs/ja/tutorial/2-pages/2.mdx +++ b/src/content/docs/ja/tutorial/2-pages/2.mdx @@ -30,7 +30,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 2. `post-1.md`という新しい(空の)ファイルを`/posts/`フォルダに追加します。 -3. プレビュー用URLの末尾に`/posts/post-1`を追加して、このページをブラウザで確認します。(たとえば`localhost:3000/posts/post-1`) +3. プレビュー用URLの末尾に`/posts/post-1`を追加して、このページをブラウザで確認します。(たとえば`http://localhost:4321/posts/post-1`) 4. ブラウザのプレビュー用URLを変更して、代わりに`/posts/post-2`を表示します。(これはまだ作成していないページです。) @@ -70,7 +70,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; Astroチュートリアルを終え、さらに記事を追加していきます。これからもこの場所をご覧ください。 ``` -2. `localhost:3000/posts/post-1`でブラウザのプレビューを再度確認します。今度はこのページにコンテンツが表示されるはずです。 +2. `http://localhost:4321/posts/post-1`でブラウザのプレビューを再度確認します。今度はこのページにコンテンツが表示されるはずです。 3. ブラウザの開発者ツールを使用して、このページを検査します。HTML要素を何も入力していないにもかかわらず、MarkdownがHTMLに変換されていることに注意してください。見出し、段落、リスト項目などの要素が表示されます。 diff --git a/src/content/docs/ja/tutorial/4-layouts/2.mdx b/src/content/docs/ja/tutorial/4-layouts/2.mdx index 92dea9dd9fb56..2ffcbf84a5312 100644 --- a/src/content/docs/ja/tutorial/4-layouts/2.mdx +++ b/src/content/docs/ja/tutorial/4-layouts/2.mdx @@ -53,7 +53,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; --- ``` -4. ブラウザのプレビューで`localhost:3000/posts/post-1`を再度確認し、レイアウトによりページに追加された内容を確認します。 +4. ブラウザのプレビューで`http://localhost:4321/posts/post-1`を再度確認し、レイアウトによりページに追加された内容を確認します。 5. 同じレイアウトプロパティを他のブログ記事`post-2.md`と`post-3.md`にも追加します。ブラウザで、これらの記事にもレイアウトが適用されていることを確認します。 diff --git a/src/content/docs/ja/tutorial/4-layouts/3.mdx b/src/content/docs/ja/tutorial/4-layouts/3.mdx index e87c228096c1c..27542e788d7b8 100644 --- a/src/content/docs/ja/tutorial/4-layouts/3.mdx +++ b/src/content/docs/ja/tutorial/4-layouts/3.mdx @@ -45,7 +45,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -2. `localhost:3000/posts/post-1`をブラウザのプレビューで確認します。コンテンツは現在、以下によってレンダリングされています。 +2. `http://localhost:4321/posts/post-1`をブラウザのプレビューで確認します。コンテンツは現在、以下によってレンダリングされています。 - スタイル、ナビゲーションリンク、ソーシャルフッターを含む**メインのページレイアウト** - 記事の説明文、日付、タイトル、画像などのフロントマタープロパティを含む**ブログ記事レイアウト** @@ -66,7 +66,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -5. `localhost:3000/posts/post-1`をブラウザのプレビューで再度確認し、上で削除した行が表示されなくなり、タイトルが1回だけ表示されていることを確認します。コンテンツが重複しないよう、必要に応じて他の調整をおこなってください。 +5. `http://localhost:4321/posts/post-1`をブラウザのプレビューで再度確認し、上で削除した行が表示されなくなり、タイトルが1回だけ表示されていることを確認します。コンテンツが重複しないよう、必要に応じて他の調整をおこなってください。 以下のことを確認してください。 diff --git a/src/content/docs/ja/tutorial/5-astro-api/1.mdx b/src/content/docs/ja/tutorial/5-astro-api/1.mdx index d248da635f371..3860ddf1cedd8 100644 --- a/src/content/docs/ja/tutorial/5-astro-api/1.mdx +++ b/src/content/docs/ja/tutorial/5-astro-api/1.mdx @@ -82,7 +82,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 記事のリストを作成するために`Astro.glob()`がすべての記事データのリストを返しているので、この記事は他のブログ記事と一緒に表示されるはずです。 ``` -4. ブラウザのプレビューで`localhost:3000/blog`のブログページに再度アクセスし、新しいブログ記事を含む4つの項目のリストへと更新されているのを確認してください。 +4. ブラウザのプレビューで`http://localhost:4321/blog`のブログページに再度アクセスし、新しいブログ記事を含む4つの項目のリストへと更新されているのを確認してください。 diff --git a/src/content/docs/ja/tutorial/5-astro-api/2.mdx b/src/content/docs/ja/tutorial/5-astro-api/2.mdx index fe3f8bfc448d9..49f060fdf9f13 100644 --- a/src/content/docs/ja/tutorial/5-astro-api/2.mdx +++ b/src/content/docs/ja/tutorial/5-astro-api/2.mdx @@ -55,7 +55,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 3. すべてのブログ記事が少なくとも1つのタグを含んでいることを確認します。`tags: ["ブログ"]`のように、配列として書く必要があります。 -4. ブラウザのプレビューで`localhost:3000/tags/astro`にアクセスすると、`[tag].astro`から動的に生成されたページが表示されるはずです。`/tags/成功`、`/tags/コミュニティ`、`/tags/公開学習`など、その他の各カスタムタグについてページが作成されていることも確認してください。これらの新しいページを表示するには、まず開発サーバーを終了して再起動する必要があるかもしれません。 +4. ブラウザのプレビューで`http://localhost:4321/tags/astro`にアクセスすると、`[tag].astro`から動的に生成されたページが表示されるはずです。`/tags/成功`、`/tags/コミュニティ`、`/tags/公開学習`など、その他の各カスタムタグについてページが作成されていることも確認してください。これらの新しいページを表示するには、まず開発サーバーを終了して再起動する必要があるかもしれません。 ## 動的ルートでpropsを使用する @@ -268,7 +268,7 @@ const { posts } = Astro.props; これで、ブラウザのプレビューで任意のタグページを表示できるようになりました。 -`localhost:3000/tags/コミュニティ`に移動すると、`コミュニティ`というタグが付いたブログ記事のリストが表示されるはずです。同様に、`localhost:3000/tags/公開学習`では、`公開学習`というタグが付いたブログ記事のリストが表示されます。 +`http://localhost:4321/tags/コミュニティ`に移動すると、`コミュニティ`というタグが付いたブログ記事のリストが表示されるはずです。同様に、`http://localhost:4321/tags/公開学習`では、`公開学習`というタグが付いたブログ記事のリストが表示されます。 次のセクションでは、これらのページへのナビゲーションリンクを作成します。 diff --git a/src/content/docs/ja/tutorial/5-astro-api/3.mdx b/src/content/docs/ja/tutorial/5-astro-api/3.mdx index 40e1d5dadb903..3a64e8ca4d039 100644 --- a/src/content/docs/ja/tutorial/5-astro-api/3.mdx +++ b/src/content/docs/ja/tutorial/5-astro-api/3.mdx @@ -34,7 +34,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 1. `src/pages/tags/`ディレクトリに新しいファイル`index.astro`を作成します。 -2. `localhost:3000/tags`に移動して、サイトにこのURLのページが含まれていることを確認します。中身は空ですが、ページは存在します。 +2. `http://localhost:4321/tags`に移動して、サイトにこのURLのページが含まれていることを確認します。中身は空ですが、ページは存在します。 3. `src/pages/tags/index.astro`に、レイアウトを使用して最小限のページを作成します。これは以前にもやりましたね! @@ -195,7 +195,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -3. ブラウザのプレビューで`localhost:3000/tags`を開き、新しいスタイルが適用されていること、ページの各タグがそれぞれのタグページへのリンクとして機能していることを確認します。 +3. ブラウザのプレビューで`http://localhost:4321/tags`を開き、新しいスタイルが適用されていること、ページの各タグがそれぞれのタグページへのリンクとして機能していることを確認します。 ### コードの確認 @@ -239,7 +239,7 @@ const pageTitle = "Tag Index"; ## このページをナビゲーションに追加する -今の時点で、`localhost:3000/tags`に移動してこのページを表示できます。そしてこのページから、個々のタグページへのリンクをクリックできます。 +今の時点で、`http://localhost:4321/tags`に移動してこのページを表示できます。そしてこのページから、個々のタグページへのリンクをクリックできます。 しかし、このページをウェブサイトの他のページから見つけられるようにする必要がまだあります。 diff --git a/src/content/docs/ja/tutorial/5-astro-api/4.mdx b/src/content/docs/ja/tutorial/5-astro-api/4.mdx index 45437fc3aafb8..9a7d554295a09 100644 --- a/src/content/docs/ja/tutorial/5-astro-api/4.mdx +++ b/src/content/docs/ja/tutorial/5-astro-api/4.mdx @@ -113,7 +113,7 @@ Astroは、ウェブサイトにRSSフィードを素早く追加するための -4. `localhost:3000/rss.xml`にアクセスし、各`.md`ファイルに対応する`item`を含んだページに(フォーマットされていない)テキストが表示されることを確認します。各アイテムには、`title`、`url`、`description`など、ブログ記事の情報が含まれているはずです。 +4. `http://localhost:4321/rss.xml`にアクセスし、各`.md`ファイルに対応する`item`を含んだページに(フォーマットされていない)テキストが表示されることを確認します。各アイテムには、`title`、`url`、`description`など、ブログ記事の情報が含まれているはずです。 :::tip[リーダーでrssフィードを表示する] フィードリーダーをダウンロードするか、オンラインのフィードリーダーサービスにサインアップし、自分のNetlify URLを追加してサイトを購読します。このリンクを他の人に共有すれば、記事に購読し、新しい記事が公開されたときに通知を受け取ってもらうようにもできます。 diff --git a/src/content/docs/ja/tutorial/6-islands/2.mdx b/src/content/docs/ja/tutorial/6-islands/2.mdx index e55c65d947db0..838c98d5b3847 100644 --- a/src/content/docs/ja/tutorial/6-islands/2.mdx +++ b/src/content/docs/ja/tutorial/6-islands/2.mdx @@ -68,7 +68,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -3. ブラウザのプレビューで`localhost:3000`にアクセスし、すべてのページにアイコンが表示されていることを確認します。クリックしてみても構いませんが、まだこれをインタラクティブにするためのスクリプトを書いていないため、何も起こりません。 +3. ブラウザのプレビューで`http://localhost:4321`にアクセスし、すべてのページにアイコンが表示されていることを確認します。クリックしてみても構いませんが、まだこれをインタラクティブにするためのスクリプトを書いていないため、何も起こりません。 ## ダークテーマのためのCSSスタイルを追加する @@ -133,7 +133,7 @@ Astroコンポーネントにインタラクティブな機能を追加するに ``` -2. ブラウザのプレビューで`localhost:3000`を開き、テーマアイコンをクリックします。ライトモードとダークモードが切り替わることを確認してください。 +2. ブラウザのプレビューで`http://localhost:4321`を開き、テーマアイコンをクリックします。ライトモードとダークモードが切り替わることを確認してください。 diff --git a/src/content/docs/ko/install/auto.mdx b/src/content/docs/ko/install/auto.mdx index 8ab31077c4b5e..bf920f74bc969 100644 --- a/src/content/docs/ko/install/auto.mdx +++ b/src/content/docs/ko/install/auto.mdx @@ -81,7 +81,7 @@ Astro에는 프로젝트 개발에 필요한 모든 것을 갖춘 개발 서버 -서버가 정상적으로 실행됐다면 [http://localhost:3000/](http://localhost:3000/)에서 동작하는 프로젝트를 확인할 수 있습니다. +서버가 정상적으로 실행됐다면 [http://localhost:4321/](http://localhost:4321/)에서 동작하는 프로젝트를 확인할 수 있습니다. Astro는 `src/` 디렉터리 안의 변경 사항을 자동으로 감지합니다. 따라서 개발 중에 변경 사항을 적용하기 위해 서버를 재시작할 필요가 없습니다. diff --git a/src/content/docs/pl/install/auto.mdx b/src/content/docs/pl/install/auto.mdx index 5a45a10ffc1f2..5102f3308c630 100644 --- a/src/content/docs/pl/install/auto.mdx +++ b/src/content/docs/pl/install/auto.mdx @@ -81,7 +81,7 @@ Każdy szablon startowy posiada wstępnie skonfigurowany skrypt, który uruchomi -Jeśli wszystko pójdzie dobrze, Astro powinno teraz wyświetlać twój projekt na [http://localhost:3000/](http://localhost:3000/)! +Jeśli wszystko pójdzie dobrze, Astro powinno teraz wyświetlać twój projekt na [http://localhost:4321/](http://localhost:4321/)! Astro będzie nasłuchiwał zmian plików w katalogu `src/`, więc nie będziesz musiał restartować serwera, gdy będziesz dokonywał zmian podczas tworzenia. diff --git a/src/content/docs/pt-br/guides/testing.mdx b/src/content/docs/pt-br/guides/testing.mdx index 6ee001637da54..8ec8574886baa 100644 --- a/src/content/docs/pt-br/guides/testing.mdx +++ b/src/content/docs/pt-br/guides/testing.mdx @@ -80,7 +80,7 @@ export default defineConfig({ ```js title="cypress/e2e/index.cy.js" it('títulos estão corretos', () => { - const pagina = cy.visit('http://localhost:3000'); + const pagina = cy.visit('http://localhost:4321'); pagina.get('title').should('have.text', 'Astro e incrível!') pagina.get('h1').should('have.text', 'Olá mundo do Astro'); @@ -88,7 +88,7 @@ export default defineConfig({ ``` :::tip[defina um baseUrl] - Você pode definir [`"baseUrl": "http://localhost:3000"`](https://docs.cypress.io/guides/end-to-end-testing/testing-your-app#Step-3-Configure-Cypress) no arquivo de configuração `cypress.config.js` para usar `cy.visit("/")` ao invés de `cy.visit("http://localhost:3000/")` para uma URL mais conveniente. + Você pode definir [`"baseUrl": "http://localhost:4321"`](https://docs.cypress.io/guides/end-to-end-testing/testing-your-app#Step-3-Configure-Cypress) no arquivo de configuração `cypress.config.js` para usar `cy.visit("/")` ao invés de `cy.visit("http://localhost:4321/")` para uma URL mais conveniente. ::: ### Executando seus testes do Cypress @@ -192,14 +192,14 @@ Como alternativa, você pode instalar o Playwright dentro do seu projeto Astro u import { test, expect } from '@playwright/test'; test('metadados estão corretos', async ({ page }) => { - await page.goto("http://localhost:3000/"); + await page.goto("http://localhost:4321/"); await expect(page).toHaveTitle('Astro é incrível'); }); ``` :::tip[Defina a URL base] - Você pode definir [`"baseURL": "http://localhost:3000"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) no arquivo de configuração `playwright.config.ts` para usar `page.goto("/")` ao invés de `page.goto("http://localhost:3000/")` em prol de uma URL mais conveniente. + Você pode definir [`"baseURL": "http://localhost:4321"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) no arquivo de configuração `playwright.config.ts` para usar `page.goto("/")` ao invés de `page.goto("http://localhost:4321/")` em prol de uma URL mais conveniente. ::: ### Executando seus testes com Playwright @@ -237,12 +237,12 @@ Aqui está um exemplo da configuração e dos comandos necessários utilizando o export default defineConfig({ webServer: { command: 'npm run preview', - url: 'http://localhost:3000/', + url: 'http://localhost:4321/', timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, use: { - baseURL: 'http://localhost:3000/', + baseURL: 'http://localhost:4321/', }, }); ``` diff --git a/src/content/docs/pt-br/install/auto.mdx b/src/content/docs/pt-br/install/auto.mdx index 1713104ea8123..c32d77c925412 100644 --- a/src/content/docs/pt-br/install/auto.mdx +++ b/src/content/docs/pt-br/install/auto.mdx @@ -82,7 +82,7 @@ Todos os templates iniciais vem com um script pré-configurado que irá executar -Se tudo ocorrer bem, Astro deve estar servindo o seu projeto em [http://localhost:3000](http://localhost:3000)! +Se tudo ocorrer bem, Astro deve estar servindo o seu projeto em [http://localhost:4321](http://localhost:4321)! Astro irá observar as mudanças em arquivos no seu diretório `src/`, logo você não precisa reiniciar o servidor enquanto faz mudanças durante o desenvolvimento. diff --git a/src/content/docs/pt-br/reference/cli-reference.mdx b/src/content/docs/pt-br/reference/cli-reference.mdx index 778abc1cd90b8..1879be57df06f 100644 --- a/src/content/docs/pt-br/reference/cli-reference.mdx +++ b/src/content/docs/pt-br/reference/cli-reference.mdx @@ -200,7 +200,7 @@ Utilize essas flags para customizar o comportamento do servidor de desenvolvimen #### `--port` -Especifica em qual porta executar. Por padrão, `3000`. +Especifica em qual porta executar. Por padrão, `4321`. #### `--host [endereço opcional do host]` diff --git a/src/content/docs/pt-br/tutorial/1-setup/2.mdx b/src/content/docs/pt-br/tutorial/1-setup/2.mdx index ca4a9b496f6fa..dfc3b5cbfe082 100644 --- a/src/content/docs/pt-br/tutorial/1-setup/2.mdx +++ b/src/content/docs/pt-br/tutorial/1-setup/2.mdx @@ -119,7 +119,7 @@ Seus arquivos do projeto contém todo o código necessário para mostrar um webs 1. Clique no link `localhost` em sua janela do terminal para ver uma pré-visualização ao vivo do seu novo website Astro! - (Astro utiliza `http://localhost:3000` por padrão se a porta 3000 estiver disponível.) + (Astro utiliza `http://localhost:4321` por padrão se a porta 4321 estiver disponível.) É assim que o template inicial "Empty Project" do Astro deve se parecer no seu navegador: diff --git a/src/content/docs/pt-br/tutorial/2-pages/1.mdx b/src/content/docs/pt-br/tutorial/2-pages/1.mdx index 95921f83052ab..abb3b02b3f5f5 100644 --- a/src/content/docs/pt-br/tutorial/2-pages/1.mdx +++ b/src/content/docs/pt-br/tutorial/2-pages/1.mdx @@ -32,7 +32,7 @@ Agora que você sabe que arquivos `.astro` são responsáveis pelas páginas no Seu editor pode mostrar um círculo branco sólido no rótulo da aba para esse arquivo. Isso significa que o arquivo ainda não foi salvo. Dentro do menu Arquivo no VS Code, habilite "Salvamento Automático" e você não deve mais precisar salvar quaisquer arquivos manualmente. ::: -4. Adicione `/sobre` ao final da URL de pré-visualização do seu website na barra de endereço e verifique que você consegue ver uma página carregando lá. (e.x. `http://localhost:3000/sobre`) +4. Adicione `/sobre` ao final da URL de pré-visualização do seu website na barra de endereço e verifique que você consegue ver uma página carregando lá. (e.x. `http://localhost:4321/sobre`) Agora, sua página "Sobre" deve se parecer exatamente com a primeira página, mas nós iremos mudar isso! diff --git a/src/content/docs/pt-br/tutorial/2-pages/2.mdx b/src/content/docs/pt-br/tutorial/2-pages/2.mdx index b86b1fa791656..312d8405bfcb6 100644 --- a/src/content/docs/pt-br/tutorial/2-pages/2.mdx +++ b/src/content/docs/pt-br/tutorial/2-pages/2.mdx @@ -29,7 +29,7 @@ Agora que você construiu páginas utilizando arquivos `.astro`, vamos fazer alg 2. Adicione um novo arquivo `post-1.md` (vazio) dentro da sua nova pasta `/postagens/`. -3. Procure por essa página na pré-visualização do seu navegador adicionando `/postagens/post-1` ao fim da sua URL de pré-visualização existente. (e.x. `localhost:3000/postagens/post-1`) +3. Procure por essa página na pré-visualização do seu navegador adicionando `/postagens/post-1` ao fim da sua URL de pré-visualização existente. (e.x. `localhost:4321/postagens/post-1`) 4. Modifique a URL de pré-visualização do navegador para ver `/postagens/post-2` ao invés disso. (Essa é uma página que você ainda não criou.) @@ -69,7 +69,7 @@ Agora que você construiu páginas utilizando arquivos `.astro`, vamos fazer alg Eu irei completar o tutorial do Astro, e então continuarei adicionando mais postagens. Olhe por aqui para o que vem a frente. ``` -2. Verifique a pré-visualização do seu navegador novamente em `localhost:3000/postagens/post-1`. Você deve agora ver conteúdo nessa página. +2. Verifique a pré-visualização do seu navegador novamente em `http://localhost:4321/postagens/post-1`. Você deve agora ver conteúdo nessa página. 3. Use as Ferramentas do Desenvolvedor do seu navegador para inspecionar nessa página. Perceba que apesar de você não ter digitado quaisquer elementos HTML, seu Markdown foi convertido para HTML. Você pode ver elementos assim como cabeçalhos, parágrafos e itens de listas. diff --git a/src/content/docs/pt-br/tutorial/4-layouts/2.mdx b/src/content/docs/pt-br/tutorial/4-layouts/2.mdx index 8a4ceeff2767c..eb8d246d22678 100644 --- a/src/content/docs/pt-br/tutorial/4-layouts/2.mdx +++ b/src/content/docs/pt-br/tutorial/4-layouts/2.mdx @@ -54,7 +54,7 @@ Quando você inclui a propriedade frontmatter `layout` em um arquivo `.md`, todo --- ``` -4. Verifique a pré-visualização do seu navegador novamente em `localhost:3000/posts/post-1` e note o que o layout adicionou a sua página. +4. Verifique a pré-visualização do seu navegador novamente em `http://localhost:4321/posts/post-1` e note o que o layout adicionou a sua página. 5. Adicione a mesma propriedade de layout para suas duas outras postagens do blog `post-2.md` e `post-3.md`. Verifique em seu navegador que seu layout também é aplicado nessas postagens. diff --git a/src/content/docs/pt-br/tutorial/4-layouts/3.mdx b/src/content/docs/pt-br/tutorial/4-layouts/3.mdx index c2982d7031354..6319684098047 100644 --- a/src/content/docs/pt-br/tutorial/4-layouts/3.mdx +++ b/src/content/docs/pt-br/tutorial/4-layouts/3.mdx @@ -44,7 +44,7 @@ Você já tem um `LayoutBase.astro` para definir o layout geral da suas páginas ``` -2. Verifique a pré-visualização do seu navegador `localhost:3000/posts/post-1`. Agora você deve ver conteúdo renderizado pelo: +2. Verifique a pré-visualização do seu navegador `http://localhost:4321/posts/post-1`. Agora você deve ver conteúdo renderizado pelo: - Seu **layout de página principal**, incluindo seus estilos, links de navegação e rodapé de redes sociais. - Seu **layout de postagem do blog**, incluindo propriedades frontmatter como a descrição, data, título e imagem @@ -65,7 +65,7 @@ Você já tem um `LayoutBase.astro` para definir o layout geral da suas páginas ``` -5. Verifique sua pré-visualização do navegador novamente em `localhost:3000/posts/post-1` e cheque que essa linha não é mais mostrada e seu título é mostrado apenas uma vez. Faça quaisquer outros ajustes necessários para garantir que você não tenha nenhum conteúdo duplicado. +5. Verifique sua pré-visualização do navegador novamente em `http://localhost:4321/posts/post-1` e cheque que essa linha não é mais mostrada e seu título é mostrado apenas uma vez. Faça quaisquer outros ajustes necessários para garantir que você não tenha nenhum conteúdo duplicado. Certifique-se de que: diff --git a/src/content/docs/pt-br/tutorial/5-astro-api/1.mdx b/src/content/docs/pt-br/tutorial/5-astro-api/1.mdx index 825eb58aff15a..9b0ae421f4209 100644 --- a/src/content/docs/pt-br/tutorial/5-astro-api/1.mdx +++ b/src/content/docs/pt-br/tutorial/5-astro-api/1.mdx @@ -81,7 +81,7 @@ Agora que você tem algumas postagens do blog para adicionar links para, vamos c Esta postagem deve aparecer junto das minhas outras postagens do blog, pois `Astro.glob()` está retornando uma lista de todas as minhas postagens para criar minha lista. ``` -4. Revisite a página do seu blog na pré-visualização do seu navegador em `localhost:3000/blog` e procure por uma lista atualizada com quatro itens, incluindo sua nova postagem no blog! +4. Revisite a página do seu blog na pré-visualização do seu navegador em `http://localhost:4321/blog` e procure por uma lista atualizada com quatro itens, incluindo sua nova postagem no blog! diff --git a/src/content/docs/pt-br/tutorial/5-astro-api/2.mdx b/src/content/docs/pt-br/tutorial/5-astro-api/2.mdx index 98ba537b37ff3..4cecec99cafdb 100644 --- a/src/content/docs/pt-br/tutorial/5-astro-api/2.mdx +++ b/src/content/docs/pt-br/tutorial/5-astro-api/2.mdx @@ -55,7 +55,7 @@ Você pode criar conjuntos inteiros de páginas dinamicamente utilizando arquivo 3. Certifique-se de que toda postagem do blog contém pelo menos uma tag, escrito como um array, e.x. `tags: ["blogueirando"]`. -4. Visite `localhost:3000/tags/astro` na pré-visualização do seu navegador e você deve ver uma página, gerada dinamicamente de `[tag].astro`. Verifique que você também tem páginas criadas para cada uma das suas tags em `/tags/sucessos`, `/tags/comunidade`, `/tags/aprendendo%20em%20público`, etc., ou para cada uma de suas tags customizadas. Você pode precisar fechar e reiniciar o servidor de desenvolvimento primeiro para ver essas novas páginas. +4. Visite `http://localhost:4321/tags/astro` na pré-visualização do seu navegador e você deve ver uma página, gerada dinamicamente de `[tag].astro`. Verifique que você também tem páginas criadas para cada uma das suas tags em `/tags/sucessos`, `/tags/comunidade`, `/tags/aprendendo%20em%20público`, etc., ou para cada uma de suas tags customizadas. Você pode precisar fechar e reiniciar o servidor de desenvolvimento primeiro para ver essas novas páginas. ## Utilize props em rotas dinâmicas @@ -268,7 +268,7 @@ const { posts } = Astro.props; Agora, você deve ser capaz de visitar qualquer uma das suas páginas de tag na sua pré-visualização do navegador. -Navegue para `localhost:3000/tags/comunidade` e você deve ver uma lista com apenas suas postagens do blog com a tag `comunidade`. Da mesma forma que `localhost:3000/tags/aprendendo%20em%20publico` deve apenas mostrar uma lista de postagens do blog com a tag `aprendendo em público`. +Navegue para `http://localhost:4321/tags/comunidade` e você deve ver uma lista com apenas suas postagens do blog com a tag `comunidade`. Da mesma forma que `http://localhost:4321/tags/aprendendo%20em%20publico` deve apenas mostrar uma lista de postagens do blog com a tag `aprendendo em público`. Na próxima seção, você irá criar links de navegação para essas páginas. diff --git a/src/content/docs/pt-br/tutorial/5-astro-api/3.mdx b/src/content/docs/pt-br/tutorial/5-astro-api/3.mdx index 5b978fb2f9686..39eae1d3dc57f 100644 --- a/src/content/docs/pt-br/tutorial/5-astro-api/3.mdx +++ b/src/content/docs/pt-br/tutorial/5-astro-api/3.mdx @@ -33,7 +33,7 @@ Porém, já que você já tem o diretório `/tags/`, você pode se aproveitar de 1. Crie um novo arquivo `index.astro` no diretório `src/pages/tags/`. -2. Navegue para `localhost:3000/tags` e verifique que seu site agora contém uma página nessa URL. Ela estará vazia, mas vai existir. +2. Navegue para `http://localhost:4321/tags` e verifique que seu site agora contém uma página nessa URL. Ela estará vazia, mas vai existir. 3. Crie uma página mínima em `src/pages/tags/index.astro` que utiliza seu layout. Você já fez isso anteriormente! @@ -195,7 +195,7 @@ Ao invés de criar items em uma lista desordenada dessa vez, crie um `

` para ``` -3. Cheque a pré-visualização do seu navegador em `localhost:3000/tags` para verificar que você tem uns novos estilos e que cada uma das tags na página tem um link funcional para sua própria página de tag individual. +3. Cheque a pré-visualização do seu navegador em `http://localhost:4321/tags` para verificar que você tem uns novos estilos e que cada uma das tags na página tem um link funcional para sua própria página de tag individual. ### Check In de Código @@ -238,7 +238,7 @@ const tituloPagina = "Índice de Tags"; ## Adicione essa página à sua navegação -Neste momento, você pode navegar para `localhost:3000/tags` e ver essa página. A partir dessa página, você pode clicar em links para suas páginas individuais de tags. +Neste momento, você pode navegar para `http://localhost:4321/tags` e ver essa página. A partir dessa página, você pode clicar em links para suas páginas individuais de tags. Porém, você ainda precisa fazer com que essas páginas possam ser encontradas a partir de outras páginas no seu website. diff --git a/src/content/docs/pt-br/tutorial/5-astro-api/4.mdx b/src/content/docs/pt-br/tutorial/5-astro-api/4.mdx index c9da8fbd79d47..7729f8805734e 100644 --- a/src/content/docs/pt-br/tutorial/5-astro-api/4.mdx +++ b/src/content/docs/pt-br/tutorial/5-astro-api/4.mdx @@ -114,7 +114,7 @@ Indivíduos podem se inscrever em seu feed em um leitor de feed, e receber uma n -4. Visite `localhost:3000/rss.xml` e verifique que você pode ver texto (não formatado) na página com um `item` para cada um dos seus arquivos `.md`. Cada item deve conter informação sobre a postagem do blog como um `title`, `url`, e `description`. +4. Visite `http://localhost:4321/rss.xml` e verifique que você pode ver texto (não formatado) na página com um `item` para cada um dos seus arquivos `.md`. Cada item deve conter informação sobre a postagem do blog como um `title`, `url`, e `description`. :::tip[veja seu feed rss em um leitor] Baixe um leitor de feed, ou se cadastre em um serviço de leitura de feed online e se inscreva ao seu site adicionando sua própria URL da Netlify. Você também pode compartilhar esse link com outros para que eles possam se inscrever para suas postagens, e ser notificado quando um novo é publicado. diff --git a/src/content/docs/pt-br/tutorial/6-islands/2.mdx b/src/content/docs/pt-br/tutorial/6-islands/2.mdx index 1438bc5398a45..3f49fa119cf68 100644 --- a/src/content/docs/pt-br/tutorial/6-islands/2.mdx +++ b/src/content/docs/pt-br/tutorial/6-islands/2.mdx @@ -67,7 +67,7 @@ Vamos construir um ícone clicável para permitir usuários alternarem entre um ``` -3. Visite a sua pré-visualização do navegador em `localhost:3000` para ver o ícone em todas as suas páginas agora. Você pode tentar clicá-lo, mas você ainda não escreveu um script para fazê-lo interativo. +3. Visite a sua pré-visualização do navegador em `http://localhost:4321` para ver o ícone em todas as suas páginas agora. Você pode tentar clicá-lo, mas você ainda não escreveu um script para fazê-lo interativo. ## Adicione estilos CSS para um tema escuro @@ -132,7 +132,7 @@ Para adicionar interatividade para um componente Astro, você pode utilizar uma ``` -2. Verifique sua pré-visualização do navegador em `localhost:3000` e clique no ícone de tema. Verifique que você pode mudar entre os modos claro e escuro. +2. Verifique sua pré-visualização do navegador em `http://localhost:4321` e clique no ícone de tema. Verifique que você pode mudar entre os modos claro e escuro. diff --git a/src/content/docs/ru/guides/markdown-content.mdx b/src/content/docs/ru/guides/markdown-content.mdx index d2a3d35d10d9b..17f25688d0733 100644 --- a/src/content/docs/ru/guides/markdown-content.mdx +++ b/src/content/docs/ru/guides/markdown-content.mdx @@ -25,7 +25,7 @@ Astro определяет любые `.md` или `.mdx` файлы внутр Чтобы начать использовать Markdown в Astro, добавьте новый файл `page-1.md` к вашему проекту в папке `src/pages/`. Скопируйте приведенный ниже базовый шаблон в свой файл, а затем просмотрите отрисованный HTML-код в предварительном просмотре вашего браузера. -Обычно, это [http://localhost:3000/page-1](http://localhost:3000/page-1). +Обычно, это [http://localhost:4321/page-1](http://localhost:4321/page-1). diff --git a/src/content/docs/ru/guides/testing.mdx b/src/content/docs/ru/guides/testing.mdx index db31d6b749aae..c6305a8291761 100644 --- a/src/content/docs/ru/guides/testing.mdx +++ b/src/content/docs/ru/guides/testing.mdx @@ -66,14 +66,14 @@ Playwright - фреймворк для end-to-end тестирования ве import { test, expect } from '@playwright/test'; test('meta is correct', async ({ page }) => { - await page.goto("http://localhost:3000/"); + await page.goto("http://localhost:4321/"); await expect(page).toHaveTitle('Astro is awesome!'); }); ``` :::tip[Укажите baseurl] -Вы можете указать [`"baseURL": "http://localhost:3000"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) в конфигурационном файле `playwright.config.ts`, чтобы использовать `page.goto("/")` вместо `page.goto("http://localhost:3000/")` для более удобного URL. +Вы можете указать [`"baseURL": "http://localhost:4321"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) в конфигурационном файле `playwright.config.ts`, чтобы использовать `page.goto("/")` вместо `page.goto("http://localhost:4321/")` для более удобного URL. ::: ### Запуск ваших Playwright тестов @@ -110,12 +110,12 @@ import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { webServer: { command: 'yarn preview', - url: 'http://localhost:3000/app/', + url: 'http://localhost:4321/app/', timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, use: { - baseURL: 'http://localhost:3000/app/', + baseURL: 'http://localhost:4321/app/', }, }; export default config; diff --git a/src/content/docs/ru/install/auto.mdx b/src/content/docs/ru/install/auto.mdx index c10447e8253b4..efde37809fd49 100644 --- a/src/content/docs/ru/install/auto.mdx +++ b/src/content/docs/ru/install/auto.mdx @@ -86,7 +86,7 @@ Astro идет со встроенным сервером для разрабо -Если все пройдет хорошо, Astro будет использовать [http://localhost:3000/](http://localhost:3000/) для вашего проекта! +Если все пройдет хорошо, Astro будет использовать [http://localhost:4321/](http://localhost:4321/) для вашего проекта! Astro будет следить за изменениями файлов в вашей директории `src/`, так что, вам не нужно перезапускать сервер после внесения изменений во время разработки. diff --git a/src/content/docs/ru/tutorial/1-setup/2.mdx b/src/content/docs/ru/tutorial/1-setup/2.mdx index 6bba0f160958f..58dc18ae7ba7a 100644 --- a/src/content/docs/ru/tutorial/1-setup/2.mdx +++ b/src/content/docs/ru/tutorial/1-setup/2.mdx @@ -118,9 +118,9 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; Ваши проектные файлы содержат весь необходимый код для отображения веб-сайта Astro, но браузер отвечает за отображение вашего кода в виде веб-страниц. -1. Щелкните ссылку `localhost` в окне терминала, чтобы увидеть живой предварительный просмотр вашего нового веб-сайта Astro! +1. Щелкните ссылку `http://localhost` в окне терминала, чтобы увидеть живой предварительный просмотр вашего нового веб-сайта Astro! - (Astro по умолчанию использует `http://localhost:3000`, если порт 3000 доступен.) + (Astro по умолчанию использует `http://localhost:4322`, если порт 4321 доступен.) Вот как должен выглядеть стартовый сайт Astro «Empty Project» в браузерном предварительном просмотре: diff --git a/src/content/docs/ru/tutorial/2-pages/1.mdx b/src/content/docs/ru/tutorial/2-pages/1.mdx index bf91c303a616c..4b1f7d784a2ed 100644 --- a/src/content/docs/ru/tutorial/2-pages/1.mdx +++ b/src/content/docs/ru/tutorial/2-pages/1.mdx @@ -33,7 +33,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; Ваш редактор может показывать круглую белую иконку на вкладке для этого файла. Это означает, что файл еще не сохранен. В меню Файл в VS Code включите «Автоматическое сохранение», и вам больше не нужно будет сохранять файлы вручную. ::: -4. Добавьте `/about` в конце URL-адреса просмотра вашего сайта в строке адреса и проверьте, что вы можете загрузить страницу. (например, `http://localhost:3000/about`) +4. Добавьте `/about` в конце URL-адреса просмотра вашего сайта в строке адреса и проверьте, что вы можете загрузить страницу. (например, `http://localhost:4321/about`) Сейчас ваша страница «О сайте» должна выглядеть точно так же, как первая страница, но мы это изменим! diff --git a/src/content/docs/ru/tutorial/2-pages/2.mdx b/src/content/docs/ru/tutorial/2-pages/2.mdx index ca3caf87fc84b..c36de5905a983 100644 --- a/src/content/docs/ru/tutorial/2-pages/2.mdx +++ b/src/content/docs/ru/tutorial/2-pages/2.mdx @@ -32,7 +32,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 3. Найти эту страницу в браузерном предпросмотре, добавив `/posts/post-1` в конец вашего существующего URL-адреса предварительного просмотра. - (например, `localhost:3000/posts/post-1`) + (например, `http://localhost:4321/posts/post-1`) 4. Измените URL-адрес предварительного просмотра в браузере, чтобы просмотреть `/posts/post-2` вместо этого. (Это страница, которую вы еще не создали.) @@ -72,7 +72,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; Я завершу учебник Astro, а затем продолжу добавлять новые записи. Следите за обновлениями. ``` -2. Проверьте предварительный просмотр в браузере снова `localhost:3000/posts/post-1`. Теперь на этой странице должно быть содержимое. +2. Проверьте предварительный просмотр в браузере снова `http://localhost:4321/posts/post-1`. Теперь на этой странице должно быть содержимое. 3. Используйте инструменты разработчика вашего браузера, чтобы проверить эту страницу. Обратите внимание, что хотя вы не ввели никаких элементов HTML, ваш Markdown был преобразован в HTML. Вы можете увидеть элементы, такие как заголовки, абзацы и пункты списка. diff --git a/src/content/docs/ru/tutorial/4-layouts/2.mdx b/src/content/docs/ru/tutorial/4-layouts/2.mdx index 4c33b01c6db17..fb5b43648a7e7 100644 --- a/src/content/docs/ru/tutorial/4-layouts/2.mdx +++ b/src/content/docs/ru/tutorial/4-layouts/2.mdx @@ -54,7 +54,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; --- ``` -4. Проверьте свой проект в браузере по адресу `localhost:3000/posts/post-1` и обратите внимание, что макет добавился на вашу страницу. +4. Проверьте свой проект в браузере по адресу `http://localhost:4321/posts/post-1` и обратите внимание, что макет добавился на вашу страницу. 5. Добавьте то же свойство макета к вашим двум другим постам блога (`post-2.md` и `post-3.md`). Проверьте в вашем браузере, что макет также применен к этим постам. diff --git a/src/content/docs/ru/tutorial/4-layouts/3.mdx b/src/content/docs/ru/tutorial/4-layouts/3.mdx index 1f27aaf107af4..d6b701eedd193 100644 --- a/src/content/docs/ru/tutorial/4-layouts/3.mdx +++ b/src/content/docs/ru/tutorial/4-layouts/3.mdx @@ -44,7 +44,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -2. Проверьте предварительный просмотр в браузере по адресу `localhost:3000/posts/post-1`. Теперь вы должны видеть содержимое, отрендеренное: +2. Проверьте предварительный просмотр в браузере по адресу `http://localhost:4321/posts/post-1`. Теперь вы должны видеть содержимое, отрендеренное: - Вашим **основным макетом страницы**, включая стили, ссылки для навигации и социальные подвалы. - Вашим **макетом поста в блоге**, включая свойства frontmatter, такие как описание, дата, заголовок и изображение @@ -65,7 +65,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -5. Снова проверьте предварительный просмотр в браузере по адресу `localhost:3000/posts/post-1` и убедитесь, что эта строка больше не отображается и что ваш заголовок отображается только один раз. Внесите все необходимые корректировки, чтобы убедиться, что у вас нет дублирующегося контента. +5. Снова проверьте предварительный просмотр в браузере по адресу `http://localhost:4321/posts/post-1` и убедитесь, что эта строка больше не отображается и что ваш заголовок отображается только один раз. Внесите все необходимые корректировки, чтобы убедиться, что у вас нет дублирующегося контента. Убедитесь, что: diff --git a/src/content/docs/ru/tutorial/5-astro-api/1.mdx b/src/content/docs/ru/tutorial/5-astro-api/1.mdx index 39efb47aa8f9c..a2c9845362738 100644 --- a/src/content/docs/ru/tutorial/5-astro-api/1.mdx +++ b/src/content/docs/ru/tutorial/5-astro-api/1.mdx @@ -82,7 +82,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; Этот пост должен появиться с моими другими блог-постами, потому что `Astro.glob()` возвращает список всех моих постов, чтобы создать мой список. ``` -4. Посетите страницу вашего блога в предварительном просмотре браузера по адресу `localhost:3000/blog` и поищите обновленный список из четырех элементов, включая ваш новый блог-пост! +4. Посетите страницу вашего блога в предварительном просмотре браузера по адресу `http://localhost:4321/blog` и поищите обновленный список из четырех элементов, включая ваш новый блог-пост! diff --git a/src/content/docs/ru/tutorial/5-astro-api/2.mdx b/src/content/docs/ru/tutorial/5-astro-api/2.mdx index 9cbbde78cdece..61917f49335d6 100644 --- a/src/content/docs/ru/tutorial/5-astro-api/2.mdx +++ b/src/content/docs/ru/tutorial/5-astro-api/2.mdx @@ -53,7 +53,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 3. Убедитесь, что каждый блог-пост содержит хотя бы один тег, написанный в виде массива, например, `tags: ["blogging"]`. -4. Перейдите по адресу `localhost:3000/tags/astro` в предварительном просмотре вашего браузера, и вы должны увидеть страницу, созданную динамически из `[tag].astro`. Проверьте, созданы ли у вас страницы для каждого из ваших тегов по адресам `/tags/successes`, `/tags/community` и `/tags/learning%20in%20public` и т.д., или для каждого из ваших пользовательских тегов. Возможно, вам придется сначала выйти и перезапустить сервер разработки, чтобы увидеть эти новые страницы. +4. Перейдите по адресу `http://localhost:4321/tags/astro` в предварительном просмотре вашего браузера, и вы должны увидеть страницу, созданную динамически из `[tag].astro`. Проверьте, созданы ли у вас страницы для каждого из ваших тегов по адресам `/tags/successes`, `/tags/community` и `/tags/learning%20in%20public` и т.д., или для каждого из ваших пользовательских тегов. Возможно, вам придется сначала выйти и перезапустить сервер разработки, чтобы увидеть эти новые страницы. ## Использование props в динамических маршрутах @@ -266,7 +266,7 @@ const { posts } = Astro.props; Теперь вы должны быть в состоянии посетить любую из ваших страниц с тегами в предварительном просмотре браузера. -Перейдите к `localhost:3000/tags/community` и вы должны увидеть список только ваших блог-постов с тегом `community`. Аналогично `localhost:3000/tags/learning%20in%20public` должен отображать список блог-постов с тегом `learning in public`. +Перейдите к `http://localhost:4321/tags/community` и вы должны увидеть список только ваших блог-постов с тегом `community`. Аналогично `http://localhost:4321/tags/learning%20in%20public` должен отображать список блог-постов с тегом `learning in public`. В следующем разделе вы создадите навигационные ссылки на эти страницы. diff --git a/src/content/docs/ru/tutorial/5-astro-api/3.mdx b/src/content/docs/ru/tutorial/5-astro-api/3.mdx index 21036df2bbdc8..471304ea6dbb3 100644 --- a/src/content/docs/ru/tutorial/5-astro-api/3.mdx +++ b/src/content/docs/ru/tutorial/5-astro-api/3.mdx @@ -34,7 +34,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 1. Создайте новый файл `index.astro` в каталоге `src/pages/tags/`. -2. Перейдите по адресу `localhost:3000/tags` и убедитесь, что ваш сайт теперь содержит страницу по этому URL. Она будет пустой, но она будет существовать. +2. Перейдите по адресу `http://localhost:4321/tags` и убедитесь, что ваш сайт теперь содержит страницу по этому URL. Она будет пустой, но она будет существовать. 3. Создайте минимальную страницу в `src/pages/tags/index.astro`, которая использует ваш макет. Вы уже делали это раньше! @@ -195,7 +195,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -3. Проверьте предварительный просмотр в браузере по адресу `localhost:3000/tags`, чтобы убедиться, что у вас есть новые стили и что каждый из тегов на странице имеет рабочую ссылку на свою собственную страницу тега. +3. Проверьте предварительный просмотр в браузере по адресу `http://localhost:4321/tags`, чтобы убедиться, что у вас есть новые стили и что каждый из тегов на странице имеет рабочую ссылку на свою собственную страницу тега. ### Проверка кода @@ -239,7 +239,7 @@ const pageTitle = "Tag Index"; ## Добавьте эту страницу в вашу навигацию -В данный момент вы можете перейти по адресу `localhost:3000/tags` и увидеть эту страницу. С этой страницы вы можете переходить по ссылкам на отдельные страницы тегов. +В данный момент вы можете перейти по адресу `http://localhost:4321/tags` и увидеть эту страницу. С этой страницы вы можете переходить по ссылкам на отдельные страницы тегов. Но вам все еще нужно сделать эти страницы доступными с других страниц вашего веб-сайта. diff --git a/src/content/docs/ru/tutorial/5-astro-api/4.mdx b/src/content/docs/ru/tutorial/5-astro-api/4.mdx index 59537a4a4dc10..a3d2df5c261ba 100644 --- a/src/content/docs/ru/tutorial/5-astro-api/4.mdx +++ b/src/content/docs/ru/tutorial/5-astro-api/4.mdx @@ -115,7 +115,7 @@ Astro предоставляет специальный пакет для быс -4. Перейдите на `localhost:3000/rss.xml` и убедитесь, что вы видите (неформатированный) текст на странице с `item` для каждого из ваших файлов `.md`. Каждый элемент должен содержать информацию о посте в блоге, такую как `title`, `url` и `description`. +4. Перейдите на `http://localhost:4321/rss.xml` и убедитесь, что вы видите (неформатированный) текст на странице с `item` для каждого из ваших файлов `.md`. Каждый элемент должен содержать информацию о посте в блоге, такую как `title`, `url` и `description`. :::tip[просмотрите вашу rss-ленту в читателе] Загрузите читатель лент, или зарегистрируйтесь на онлайн-сервисе чтения лент и подпишитесь на свой сайт, добавив свой собственный URL Netlify. Вы также можете поделиться этой ссылкой с другими, чтобы они могли подписаться на ваши посты и получать уведомления при публикации нового. diff --git a/src/content/docs/ru/tutorial/6-islands/2.mdx b/src/content/docs/ru/tutorial/6-islands/2.mdx index b63bd0671c8df..05dfc09e206fe 100644 --- a/src/content/docs/ru/tutorial/6-islands/2.mdx +++ b/src/content/docs/ru/tutorial/6-islands/2.mdx @@ -68,7 +68,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -3. Посетите предварительный просмотр в браузере по адресу `localhost:3000`, чтобы увидеть иконку теперь на всех ваших страницах. Вы можете попробовать нажать на нее, но вы еще не написали скрипт, чтобы сделать ее интерактивной. +3. Посетите предварительный просмотр в браузере по адресу `http://localhost:4321`, чтобы увидеть иконку теперь на всех ваших страницах. Вы можете попробовать нажать на нее, но вы еще не написали скрипт, чтобы сделать ее интерактивной. ## Добавьте стили CSS для темной темы @@ -133,7 +133,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -2. Проверьте предварительный просмотр в браузере по адресу `localhost:3000` и нажмите на иконку темы. Убедитесь, что вы можете переключаться между светлым и темным режимами. +2. Проверьте предварительный просмотр в браузере по адресу `http://localhost:4321` и нажмите на иконку темы. Убедитесь, что вы можете переключаться между светлым и темным режимами. diff --git a/src/content/docs/zh-cn/guides/cms/contentful.mdx b/src/content/docs/zh-cn/guides/cms/contentful.mdx index 37e6511d67332..a188a7509809a 100644 --- a/src/content/docs/zh-cn/guides/cms/contentful.mdx +++ b/src/content/docs/zh-cn/guides/cms/contentful.mdx @@ -421,7 +421,7 @@ const { content, title, date } = Astro.props; ``` -在浏览器中导航到 http://localhost:3000/, 然后点击其中一篇文章,以确保你的动态路由正常工作! +在浏览器中导航到 http://localhost:4321/, 然后点击其中一篇文章,以确保你的动态路由正常工作! #### 服务器端渲染 @@ -561,4 +561,4 @@ try { 在你的 Contentful 空间的**设置**中,点击 **Webhooks** 选项卡,然后通过点击 **Add Webhook** 按钮创建一个新的 Webhook。为你的 Webhook 提供一个名称,并粘贴你在上一节中复制的 Webhook URL。最后,点击 **Save** 创建 Webhook。 -现在,每当你在 Contentful 中发布新的博客文章时,都会触发新的构建,并更新你的博客。 \ No newline at end of file +现在,每当你在 Contentful 中发布新的博客文章时,都会触发新的构建,并更新你的博客。 diff --git a/src/content/docs/zh-cn/guides/cms/kontent-ai.mdx b/src/content/docs/zh-cn/guides/cms/kontent-ai.mdx index 5aba7f6c67356..a66254979572f 100644 --- a/src/content/docs/zh-cn/guides/cms/kontent-ai.mdx +++ b/src/content/docs/zh-cn/guides/cms/kontent-ai.mdx @@ -438,7 +438,7 @@ const blogPost: BlogPost = Astro.props.blogPost ``` -切换到 Astro 预览以查看渲染的博客文章。默认情况下是:http://localhost:3000/blog/astro-is-amazing/ +切换到 Astro 预览以查看渲染的博客文章。默认情况下是:http://localhost:4321/blog/astro-is-amazing/ #### 服务端渲染 @@ -545,4 +545,4 @@ try { 在 [Kontent.ai 应用程序](https://kontent.ai/learn/docs/webhooks/javascript) 中,转到 **Environment settings -> Webhooks**。点击 **Create new webhook** 并为你的新 Webhook 提供一个名称。接着,粘贴你从 Netlify 或 Vercel 复制的 URL,并选择哪些事件应触发 Webhook。默认情况下,为了在发布的内容发生更改时重新构建你的网站,你只需要在 **Delivery API triggers** 下选择 **Publish** 和 **Unpublish** 事件。完成后,点击保存。 -现在,每当你在 Kontent.ai 中发布一篇新博客文章时,就会触发新的构建,并更新你的博客。 \ No newline at end of file +现在,每当你在 Kontent.ai 中发布一篇新博客文章时,就会触发新的构建,并更新你的博客。 diff --git a/src/content/docs/zh-cn/guides/cms/payload.mdx b/src/content/docs/zh-cn/guides/cms/payload.mdx index eb93aa6786867..7395a6b1fba04 100644 --- a/src/content/docs/zh-cn/guides/cms/payload.mdx +++ b/src/content/docs/zh-cn/guides/cms/payload.mdx @@ -74,7 +74,7 @@ import Users from "./collections/Users"; import Posts from "./collections/Posts"; export default buildConfig({ - serverURL: "http://localhost:3000", + serverURL: "http://localhost:4321", admin: { user: Users.slug, }, @@ -93,7 +93,7 @@ export default buildConfig({ 2. 进入 “Posts” 集合并创建一篇新文章。在保存后,你会注意到 API URL 出现在右下角。 -3. 在本地 PayloadCMS 服务运行的情况下,在浏览器中打开 `http://localhost:3000/api/posts` 。你应该看到一个包含你创建的文章作为对象的 JSON 文件。 +3. 在本地 PayloadCMS 服务运行的情况下,在浏览器中打开 `http://localhost:4321/api/posts` 。你应该看到一个包含你创建的文章作为对象的 JSON 文件。 ```json { @@ -120,7 +120,7 @@ export default buildConfig({ ``` :::tip[提示] -默认情况下,Astro 和 PayloadCMS 都会使用 3000 端口。你可能想要在 `src/server.ts` 文件中更改 PayloadCMS 的端口,别忘了也同时更新 `src/payload.config.ts` 中的 `serverURL` 。 +默认情况下,Astro 和 PayloadCMS 都会使用 4321 端口。你可能想要在 `src/server.ts` 文件中更改 PayloadCMS 的端口,别忘了也同时更新 `src/payload.config.ts` 中的 `serverURL` 。 ::: ### 获取数据 @@ -135,7 +135,7 @@ export default buildConfig({ --- import HomeLayout from "../layouts/HomeLayout.astro"; -const res = await fetch("https://localhost:5000/api/posts") // https://localhost:3000/api/posts 默认端口 +const res = await fetch("http://localhost:5000/api/posts") // http://localhost:4321/api/posts 默认端口 const posts = await res.json() --- @@ -163,7 +163,7 @@ const posts = await res.json() --- import HomeLayout from "../layouts/HomeLayout.astro"; -const res = await fetch("http://localhost:5000/api/posts") // https://localhost:3000/api/posts 默认端口 +const res = await fetch("http://localhost:5000/api/posts") // http://localhost:4321/api/posts 默认端口 const posts = await res.json() --- diff --git a/src/content/docs/zh-cn/guides/testing.mdx b/src/content/docs/zh-cn/guides/testing.mdx index 45478def5435f..69fc8c32a3217 100644 --- a/src/content/docs/zh-cn/guides/testing.mdx +++ b/src/content/docs/zh-cn/guides/testing.mdx @@ -80,7 +80,7 @@ export default defineConfig({ ```js title="cypress/e2e/index.cy.js" it('titles are correct', () => { - const page = cy.visit('http://localhost:3000'); + const page = cy.visit('http://localhost:4321'); page.get('title').should('have.text', 'Astro is awesome!') page.get('h1').should('have.text', 'Hello world from Astro'); @@ -88,7 +88,7 @@ export default defineConfig({ ``` :::tip[设置一个 baseUrl] - 你可以在名为 `cypress.config.js` 的配置文件中设置 [`"baseUrl": "http://localhost:3000"`](https://docs.cypress.io/guides/end-to-end-testing/testing-your-app#Step-3-Configure-Cypress) ,以便使用 `cy.visit("/")` 而不是 `cy.visit("http://localhost:3000/")` 来使用更便捷的 URL。 + 你可以在名为 `cypress.config.js` 的配置文件中设置 [`"baseUrl": "http://localhost:4321"`](https://docs.cypress.io/guides/end-to-end-testing/testing-your-app#Step-3-Configure-Cypress) ,以便使用 `cy.visit("/")` 而不是 `cy.visit("http://localhost:4321/")` 来使用更便捷的 URL。 ::: ### 运行你的 Cypress 测试 @@ -191,14 +191,15 @@ Playwright 是一个针对现代网络应用的端到端测试框架。使用 Ja import { test, expect } from '@playwright/test'; test('meta is correct', async ({ page }) => { - await page.goto("http://localhost:3000/"); + await page.goto("http://localhost:4321/"); await expect(page).toHaveTitle('Astro is awesome!'); }); ``` :::tip[设置默认网址] -你可以在 `playwright.config.ts` 配置文件中配置 [`"baseURL": "http://localhost:3000"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) 以使用 `page.goto("/")` 来替代 `page.goto("http://localhost:3000/")` 以使用更便捷的 URL。 + +你可以在 `playwright.config.ts` 配置文件中配置 [`"baseURL": "http://localhost:4321"`](https://playwright.dev/docs/api/class-testoptions#test-options-base-url) 以使用 `page.goto("/")` 来替代 `page.goto("http://localhost:4321/")` 以使用更便捷的 URL。 ::: ### 运行你的 Playwright 测试 @@ -225,6 +226,29 @@ Playwright 是一个针对现代网络应用的端到端测试框架。使用 Ja 当你使用 Playwright 配置文件中的 [`webServer`](https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests) 选项运行测试脚本时,你也可以让 Playwright 启动服务器。 +下面是使用 Yarn 时所需的配置和命令示例: + +1. 向项目根目录中的 package.json 文件添加一个测试脚本,例如 `"test:e2e": "playwright test"`。 + +2. 在 `playwright.config.ts` 中,添加 `webServer` 对象并更改命令为 `yarn preview`。 + +```js title="playwright.config.ts" ins={3-8} "yarn preview" +import type { PlaywrightTestConfig } from '@playwright/test'; +const config: PlaywrightTestConfig = { + webServer: { + command: 'yarn preview', + url: 'http://localhost:4321/app/', + timeout: 120 * 1000, + reuseExistingServer: !process.env.CI, + }, + use: { + baseURL: 'http://localhost:4321/app/', + }, +}; +export default config; +``` + +3. 执行 `yarn build`,然后执行 `yarn test:e2e` 运行 `Playwright` 测试。 下面是使用 npm 时所需的配置和命令示例: 1. 向项目根目录中的 `package.json` 文件添加一个测试脚本,例如 `"test:e2e": "playwright test"`。 @@ -237,12 +261,12 @@ Playwright 是一个针对现代网络应用的端到端测试框架。使用 Ja export default defineConfig({ webServer: { command: 'npm run preview', - url: 'http://localhost:3000/', + url: 'http://localhost:4321/', timeout: 120 * 1000, reuseExistingServer: !process.env.CI, }, use: { - baseURL: 'http://localhost:3000/', + baseURL: 'http://localhost:4321/', }, }); ``` diff --git a/src/content/docs/zh-cn/install/auto.mdx b/src/content/docs/zh-cn/install/auto.mdx index 79c0f588af21d..d81a41483204e 100644 --- a/src/content/docs/zh-cn/install/auto.mdx +++ b/src/content/docs/zh-cn/install/auto.mdx @@ -80,7 +80,7 @@ Astro 带有一个内置的开发服务器,拥有项目开发所需的一切 -如果一切顺利,Astro 现在应该可以在 [http://localhost:3000/](http://localhost:3000/) 上为你的项目提供服务了! +如果一切顺利,Astro 现在应该可以在 [http://localhost:4321/](http://localhost:4321/) 上为你的项目提供服务了! Astro 将实时监听 `src/` 目录中的文件更改,因此你在开发过程中进行更改时无需重新启动服务器。 diff --git a/src/content/docs/zh-cn/recipes/docker.mdx b/src/content/docs/zh-cn/recipes/docker.mdx index b9ab0e67d1104..6c2922b5a72ee 100644 --- a/src/content/docs/zh-cn/recipes/docker.mdx +++ b/src/content/docs/zh-cn/recipes/docker.mdx @@ -22,7 +22,7 @@ Docker 镜像和容器可以部署到许多不同的平台,例如 AWS、Azure ### 服务端渲染模式(SSR) -以下是一个 Dockerfile 示例,它将使用 Node.js 构建你的网站,并在端口 `3000` 上进行服务。这要求在 Astro 项目中安装了 [Node 适配器](/zh-cn/guides/integrations-guide/node/)。 +以下是一个 Dockerfile 示例,它将使用 Node.js 构建你的网站,并在端口 `4321` 上进行服务。这要求在 Astro 项目中安装了 [Node 适配器](/zh-cn/guides/integrations-guide/node/)。 ```docker title="Dockerfile" FROM node:lts AS runtime @@ -34,8 +34,8 @@ RUN npm install RUN npm run build ENV HOST=0.0.0.0 -ENV PORT=3000 -EXPOSE 3000 +ENV PORT=4321 +EXPOSE 4321 CMD node ./dist/server/entry.mjs ``` @@ -149,8 +149,8 @@ FROM base AS runtime COPY --from=prod-deps /app/node_modules ./node_modules COPY --from=build /app/dist ./dist ENV HOST=0.0.0.0 -ENV PORT=3000 -EXPOSE 3000 +ENV PORT=4321 +EXPOSE 4321 CMD node ./dist/server/entry.mjs ``` @@ -166,7 +166,7 @@ docker build -t . 2. 要将镜像作为本地容器运行,请使用以下命令。 -将 `` 替换为你本地机器上的空闲端口。将 `` 替换为你的 Docker 容器暴露的端口号(如上面示例中的 `3000`、`80` 或 `8080`)。 +将 `` 替换为你本地机器上的空闲端口。将 `` 替换为你的 Docker 容器暴露的端口号(如上面示例中的 `4321`、`80` 或 `8080`)。 ```bash docker run -p : diff --git a/src/content/docs/zh-cn/reference/cli-reference.mdx b/src/content/docs/zh-cn/reference/cli-reference.mdx index 2b974dc46d2fd..8f3c81dca9ab7 100644 --- a/src/content/docs/zh-cn/reference/cli-reference.mdx +++ b/src/content/docs/zh-cn/reference/cli-reference.mdx @@ -143,7 +143,7 @@ Global Flags #### `--port ` -指定运行在哪个端口。默认为 `3000`。 +指定运行在哪个端口。默认为 `4321`。 #### `--host [可选主机地址]` diff --git a/src/content/docs/zh-cn/tutorial/1-setup/2.mdx b/src/content/docs/zh-cn/tutorial/1-setup/2.mdx index 8d4de188b16a0..e0a492a07d815 100644 --- a/src/content/docs/zh-cn/tutorial/1-setup/2.mdx +++ b/src/content/docs/zh-cn/tutorial/1-setup/2.mdx @@ -115,7 +115,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 1. 点击终端窗口中的 `localhost` 链接,查看 Astro 网站的实时预览! - (如果端口 3000 可用,Astro 默认使用 `http://localhost:3000`。) + (如果端口 4321 可用,Astro 默认使用 `http://localhost:4321`。) 以下是 Astro “初始项目” 入门网站在浏览器预览中的样子: diff --git a/src/content/docs/zh-cn/tutorial/2-pages/1.mdx b/src/content/docs/zh-cn/tutorial/2-pages/1.mdx index c53122b38461f..0f3ee10c78ec7 100644 --- a/src/content/docs/zh-cn/tutorial/2-pages/1.mdx +++ b/src/content/docs/zh-cn/tutorial/2-pages/1.mdx @@ -30,7 +30,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 你的代码编辑器可能会在这个文件的导航标签上显示一个白色的圆点。这意味着该文件还没有保存。你可以在 VS Code 的文件菜单下,启用 “自动保存”,这样应该不再需要手动保存任何文件。 ::: -4. 在地址栏中的网站预览的URL末尾添加 `/about`,并检查你是否能在那里看到一个页面加载。(例如:`http://localhost:3000/about`) +4. 在地址栏中的网站预览的URL末尾添加 `/about`,并检查你是否能在那里看到一个页面加载。(例如:`http://localhost:4321/about`) 现在,你的 “关于” 页面看起来应该和第一页完全一样,但我们现在要更改一下! diff --git a/src/content/docs/zh-cn/tutorial/2-pages/2.mdx b/src/content/docs/zh-cn/tutorial/2-pages/2.mdx index 79a4c0f53e81a..e79cc5e9967eb 100644 --- a/src/content/docs/zh-cn/tutorial/2-pages/2.mdx +++ b/src/content/docs/zh-cn/tutorial/2-pages/2.mdx @@ -27,7 +27,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 2. 在新的 `/posts/` 文件夹中添加一个新的(空)文件 `post-1.md`。 -3. 通过将 `/posts/post-1` 拼接到现有预览 URL 的末尾,并在浏览器中预览此页面。(例如 `localhost:3000/posts/post-1`) +3. 通过将 `/posts/post-1` 拼接到现有预览 URL 的末尾,并在浏览器中预览此页面。(例如 `http://localhost:4321/posts/post-1`) 4. 将浏览器预览 URL 更改为查看 `/posts/post-2`。(这是你尚未创建的页面。) @@ -68,7 +68,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 我将完成 Astro 教程,然后继续编写更多内容。关注我以获取更多信息。 ``` -2. 在 `localhost:3000/posts/post-1` 再次查看你的浏览器上的页面预览。你现在应该可以在此页面上看到文章内容。 +2. 在 `localhost:4321/posts/post-1` 再次查看你的浏览器上的页面预览。你现在应该可以在此页面上看到文章内容。 3. 使用浏览器的开发工具检查此页面。请注意,虽然你没有键入任何 HTML 元素,但你的 Markdown 已转换为 HTML。你可以看到标题、段落和列表项等元素。 diff --git a/src/content/docs/zh-cn/tutorial/4-layouts/2.mdx b/src/content/docs/zh-cn/tutorial/4-layouts/2.mdx index ed6a9610db3db..3c631a3a9777b 100644 --- a/src/content/docs/zh-cn/tutorial/4-layouts/2.mdx +++ b/src/content/docs/zh-cn/tutorial/4-layouts/2.mdx @@ -50,7 +50,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; --- ``` -4. 再次检查 `localhost:3000/posts/post-1` 上的浏览器预览,并注意布局为页面添加了什么内容。 +4. 再次检查 `localhost:4321/posts/post-1` 上的浏览器预览,并注意布局为页面添加了什么内容。 5. 将相同的布局属性添加到你的另外两篇博客文章 `post-2.md` 和 `post-3.md` 中。在浏览器中验证你的布局是否也应用于这些文章。 @@ -171,4 +171,4 @@ const { frontmatter } = Astro.props; - [Astro 中的 Markdown 布局](/zh-cn/guides/markdown-content/#frontmatter-layout) - [Markdown 布局属性](/zh-cn/core-concepts/layouts/#markdown-布局的-props) -- [YAML 介绍](https://dev.to/paulasantamaria/introduction-to-yaml-125f) 外部链接 \ No newline at end of file +- [YAML 介绍](https://dev.to/paulasantamaria/introduction-to-yaml-125f) 外部链接 diff --git a/src/content/docs/zh-cn/tutorial/4-layouts/3.mdx b/src/content/docs/zh-cn/tutorial/4-layouts/3.mdx index de7b8471bbe59..69e5c7b3c9d64 100644 --- a/src/content/docs/zh-cn/tutorial/4-layouts/3.mdx +++ b/src/content/docs/zh-cn/tutorial/4-layouts/3.mdx @@ -41,7 +41,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -2. 在浏览器预览中查看 `localhost:3000/posts/post-1`。现在,你应该看到以下内容的渲染: +2. 在浏览器预览中查看 `http://localhost:4321/posts/post-1`。现在,你应该看到以下内容的渲染: - 你的**主页面布局**,包括样式、导航链接和社交页脚。 - 你的**博客文章布局**,包括描述、日期、标题和图片等前置属性。 @@ -62,7 +62,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -5. 再次检查浏览器预览 `localhost:3000/posts/post-1`,验证该行不再显示(你的标题只显示一次)。根据需要进行其他调整,确保没有重复的内容。 +5. 再次检查浏览器预览 `http://localhost:4321/posts/post-1`,验证该行不再显示(你的标题只显示一次)。根据需要进行其他调整,确保没有重复的内容。 请确保: diff --git a/src/content/docs/zh-cn/tutorial/5-astro-api/1.mdx b/src/content/docs/zh-cn/tutorial/5-astro-api/1.mdx index b589ca81a1a5b..774759432a41e 100644 --- a/src/content/docs/zh-cn/tutorial/5-astro-api/1.mdx +++ b/src/content/docs/zh-cn/tutorial/5-astro-api/1.mdx @@ -78,7 +78,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 这篇文章应该会与其他的博客文章一起显示,因为 `Astro.glob()` 会返回一个包含所有文章的列表,以创建这个文章列表。 ``` -4. 在浏览器预览中重新访问博客页面 `localhost:3000/blog`,并查看更新后的包含四篇文章的列表,其中包括你的新博客文章! +4. 在浏览器预览中重新访问博客页面 `http://localhost:4321/blog`,并查看更新后的包含四篇文章的列表,其中包括你的新博客文章! diff --git a/src/content/docs/zh-cn/tutorial/5-astro-api/2.mdx b/src/content/docs/zh-cn/tutorial/5-astro-api/2.mdx index 4dabe0f5ee0f9..993722636673a 100644 --- a/src/content/docs/zh-cn/tutorial/5-astro-api/2.mdx +++ b/src/content/docs/zh-cn/tutorial/5-astro-api/2.mdx @@ -52,7 +52,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 3. 确保每篇博客文章至少包含一个标签,以数组的形式编写,例如 `tags: ["blogging"]`。 -4. 在浏览器中访问 `localhost:3000/tags/astro`,你应该能看到一个页面,它是从 `[tag].astro` 动态生成的。检查是否还为每个标签创建了页面,例如 `/tags/successes`、`/tags/community`、`/tags/learning%20in%20public` 等,或者你自定义的标签。你可能需要先退出并重新启动开发服务器才能看到这些新页面。 +4. 在浏览器中访问 `http://localhost:4321/tags/astro`,你应该能看到一个页面,它是从 `[tag].astro` 动态生成的。检查是否还为每个标签创建了页面,例如 `/tags/successes`、`/tags/community`、`/tags/learning%20in%20public` 等,或者你自定义的标签。你可能需要先退出并重新启动开发服务器才能看到这些新页面。 ## 在动态路由中使用 props @@ -264,7 +264,7 @@ const { posts } = Astro.props; 现在,你应该能够在浏览器预览中访问任何一个标签页面。 -在浏览器中导航到 `localhost:3000/tags/community`,你应该看到一个包含标签为 `community` 的博文列表。同样地,`localhost:3000/tags/learning%20in%20public` 应该显示一个包含标签为 `learning in public` 的博文列表。 +在浏览器中导航到 `http://localhost:4321/tags/community`,你应该看到一个包含标签为 `community` 的博文列表。同样地,`http://localhost:4321/tags/learning%20in%20public` 应该显示一个包含标签为 `learning in public` 的博文列表。 在接下来的部分,你将创建导航链接到这些页面。 diff --git a/src/content/docs/zh-cn/tutorial/5-astro-api/3.mdx b/src/content/docs/zh-cn/tutorial/5-astro-api/3.mdx index 041c9eff4eabb..2954d3df916d6 100644 --- a/src/content/docs/zh-cn/tutorial/5-astro-api/3.mdx +++ b/src/content/docs/zh-cn/tutorial/5-astro-api/3.mdx @@ -31,7 +31,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; 1. 在 `src/pages/tags/` 目录中创建一个新文件 `index.astro`。 -2. 访问 `localhost:3000/tags` 并验证你的网站现在是否包含这个 URL 的页面。它将是空的,但是它已经存在了。 +2. 访问 `http://localhost:4321/tags` 并验证你的网站现在是否包含这个 URL 的页面。它将是空的,但是它已经存在了。 3. 在 `src/pages/tags/index.astro` 中创建一个使用你的布局的最小页面。你之前已经做过这个! @@ -191,7 +191,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -3. 在 `localhost:3000/tags` 上检查你的浏览器的预览,确认这些新的样式正确应用了,并且页面上的每个标签都有链接到自己独立标签页面的功能。 +3. 在 `http://localhost:4321/tags` 上检查你的浏览器的预览,确认这些新的样式正确应用了,并且页面上的每个标签都有链接到自己独立标签页面的功能。 ### 检查代码 @@ -235,7 +235,7 @@ const pageTitle = "Tag Index"; ## 将此页面添加到你的导航 -现在,你可以导航到 `localhost:3000/tags` 并查看此页面。通过这个页面,你可以点击链接进入各个标签页面。 +现在,你可以导航到 `http://localhost:4321/tags` 并查看此页面。通过这个页面,你可以点击链接进入各个标签页面。 但是,你仍然需要让访问者在其他页面也能够发现这个页面。 diff --git a/src/content/docs/zh-cn/tutorial/5-astro-api/4.mdx b/src/content/docs/zh-cn/tutorial/5-astro-api/4.mdx index ca15465943210..94f47bfdf4ee8 100644 --- a/src/content/docs/zh-cn/tutorial/5-astro-api/4.mdx +++ b/src/content/docs/zh-cn/tutorial/5-astro-api/4.mdx @@ -110,7 +110,7 @@ Astro 提供了一个可自定义包,用于快速为你的网站添加一个 R -4. 访问 `localhost:3000/rss.xml`,验证你是否可以在页面上看到(未格式化的)文本,每个 `.md` 文件都有一个 `item`。每个 `item` 应包含博客文章的信息,例如 `title`、`url` 和 `description`。 +4. 访问 `http://localhost:4321/rss.xml`,验证你是否可以在页面上看到(未格式化的)文本,每个 `.md` 文件都有一个 `item`。每个 `item` 应包含博客文章的信息,例如 `title`、`url` 和 `description`。 :::tip[在阅读器中查看你的 RSS 订阅源] 下载一个订阅源阅读器,或者注册一个在线订阅源阅读器服务,并通过添加你自己的 Netlify URL 订阅你的网站。你也可以将此链接分享给他人,让他们订阅你的文章,并在发布新文章时收到通知。 diff --git a/src/content/docs/zh-cn/tutorial/6-islands/2.mdx b/src/content/docs/zh-cn/tutorial/6-islands/2.mdx index 6b1d188d14896..adeb30f25d15d 100644 --- a/src/content/docs/zh-cn/tutorial/6-islands/2.mdx +++ b/src/content/docs/zh-cn/tutorial/6-islands/2.mdx @@ -65,7 +65,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -3. 访问 `localhost:3000` 上的浏览器预览,查看图标是否出现在所有页面上。你可以尝试点击它,但你还没有编写脚本使其具有交互性。 +3. 访问 `http://localhost:4321` 上的浏览器预览,查看图标是否出现在所有页面上。你可以尝试点击它,但你还没有编写脚本使其具有交互性。 ## 添加用于暗黑主题的 CSS 样式 @@ -130,7 +130,7 @@ import PreCheck from '~/components/tutorial/PreCheck.astro'; ``` -2. 检查 `localhost:3000` 上的浏览器预览,并单击主题图标。验证是否可以在浅色和暗黑模式之间进行切换。 +2. 检查 `http://localhost:4321` 上的浏览器预览,并单击主题图标。验证是否可以在浅色和暗黑模式之间进行切换。 diff --git a/src/content/docs/zh-tw/install/auto.mdx b/src/content/docs/zh-tw/install/auto.mdx index 0ee3d6c0c8722..bcde9c35c4828 100644 --- a/src/content/docs/zh-tw/install/auto.mdx +++ b/src/content/docs/zh-tw/install/auto.mdx @@ -79,7 +79,7 @@ Astro 本身即內建了一個開發伺服器,其附帶你在開發專案時 -若一切順利,Astro 現在應該會在 [http://localhost:3000/](http://localhost:3000/) 執行你的專案了! +若一切順利,Astro 現在應該會在 [http://localhost:4321/](http://localhost:4321/) 執行你的專案了! Astro 會偵測你 `src/` 目錄底下檔案的即時變動,所以在開發中你不需要重啟伺服器來檢視更動後的結果。