Skip to content

Commit

Permalink
docs: Update server options configuration reference (withastro#3295)
Browse files Browse the repository at this point in the history
Based on withastro/docs#422

Co-Authored-By: Rafid Muhymin Wafi <[email protected]>

Co-authored-by: Rafid Muhymin Wafi <[email protected]>
  • Loading branch information
delucis and RafidMuhymin committed May 7, 2022
1 parent 3542082 commit 2d96c76
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/@types/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}
* }
* ```
*
Expand All @@ -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 })
* }
* ```
*/
Expand All @@ -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`)
*/

/**
Expand All @@ -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);
Expand Down

0 comments on commit 2d96c76

Please sign in to comment.