diff options
author | 2022-05-07 09:56:39 +0200 | |
---|---|---|
committer | 2022-05-07 09:56:39 +0200 | |
commit | ee55d492b5184cf96546dbc68060e2329ca42d2b (patch) | |
tree | 80107055a94657630182aa2cf4ab47f7583b7b3c | |
parent | 2864d09ad4167f4690735bd433f437cd84845377 (diff) | |
download | astro-ee55d492b5184cf96546dbc68060e2329ca42d2b.tar.gz astro-ee55d492b5184cf96546dbc68060e2329ca42d2b.tar.zst astro-ee55d492b5184cf96546dbc68060e2329ca42d2b.zip |
docs: Update server options configuration reference (#3295)
Based on https://github.com/withastro/docs/pull/422/
Co-Authored-By: Rafid Muhymin Wafi <63650415+RafidMuhymin@users.noreply.github.com>
Co-authored-by: Rafid Muhymin Wafi <63650415+RafidMuhymin@users.noreply.github.com>
-rw-r--r-- | packages/astro/src/@types/astro.ts | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index 854ed875c..8a04f21e9 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -432,11 +432,11 @@ export interface AstroUserConfig { * @name Server Options * @description * - * Customize the Astro dev server, used by both `astro dev` and `astro serve`. + * Customize the Astro dev server, used by both `astro dev` and `astro preview`. * * ```js * { - * server: {port: 1234, host: true} + * server: { port: 1234, host: true} * } * ``` * @@ -445,7 +445,7 @@ export interface AstroUserConfig { * ```js * { * // Example: Use the function syntax to customize based on command - * server: (command) => ({port: command === 'dev' ? 3000 : 4000}) + * server: (command) => ({ port: command === 'dev' ? 3000 : 4000 }) * } * ``` */ @@ -457,10 +457,10 @@ export interface AstroUserConfig { * @default `false` * @version 0.24.0 * @description - * Set which network IP addresses the dev server should listen on (i.e. non-localhost IPs). + * Set which network IP addresses the server should listen on (i.e. non-localhost IPs). * - `false` - do not expose on a network IP address * - `true` - listen on all addresses, including LAN and public addresses - * - `[custom-address]` - expose on a network IP address at `[custom-address]` + * - `[custom-address]` - expose on a network IP address at `[custom-address]` (ex: `192.168.0.1`) */ /** @@ -469,9 +469,15 @@ export interface AstroUserConfig { * @type {number} * @default `3000` * @description - * Set which port the dev server should listen on. + * Set which port the server should listen on. * * If the given port is already in use, Astro will automatically try the next available port. + * + * ```js + * { + * server: { port: 8080 } + * } + * ``` */ server?: ServerConfig | ((options: { command: 'dev' | 'preview' }) => ServerConfig); |