Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[i18nIgnore] feat: change default port #3977

Merged
merged 9 commits into from
Aug 30, 2023
2 changes: 1 addition & 1 deletion src/content/docs/de/guides/markdown-content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/de/guides/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/de/install/auto.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/guides/cms/contentful.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ const { content, title, date } = Astro.props;
</html>
```

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

Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/en/guides/cms/payload.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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
{
Expand Down Expand Up @@ -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()
---

Expand Down Expand Up @@ -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()
---

Expand Down
12 changes: 6 additions & 6 deletions src/content/docs/en/guides/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ 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');
});
```

:::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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/',
},
});
```
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/install/auto.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Every starter template comes with a pre-configured script that will run `astro d
</PackageManagerTabs>


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.

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/tutorial/1-setup/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/tutorial/2-pages/1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/tutorial/2-pages/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.)

Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/tutorial/4-layouts/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/tutorial/4-layouts/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ You already have a `BaseLayout.astro` for defining the overall layout of your pa
</BaseLayout>
```

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
Expand All @@ -66,7 +66,7 @@ You already have a `BaseLayout.astro` for defining the overall layout of your pa
</BaseLayout>
```

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:
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/tutorial/5-astro-api/1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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!

<Box icon="puzzle-piece">

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/tutorial/5-astro-api/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
6 changes: 3 additions & 3 deletions src/content/docs/en/tutorial/5-astro-api/3.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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!

Expand Down Expand Up @@ -196,7 +196,7 @@ Instead of creating items in an unordered list this time, create one `<p>` for e
</style>
```

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

Expand Down Expand Up @@ -240,7 +240,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.

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/en/tutorial/5-astro-api/4.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Individuals can subscribe to your feed in a feed reader, and receive a notificat
</Fragment>
</PackageManagerTabs>

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.
Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/en/tutorial/6-islands/2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Let's build a clickable icon to let your users toggle between light or dark mode
</header>
```

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

Expand Down Expand Up @@ -133,7 +133,7 @@ To add interactivity to an Astro component, you can use a `<script>` tag. This s
</script>
```

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.



Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/es/guides/cms/contentful.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ const { content, title, date } = Astro.props;
</html>
```

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

Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/es/guides/cms/payload.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand All @@ -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
{
Expand Down Expand Up @@ -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()
---

Expand Down Expand Up @@ -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()
---

Expand Down
Loading