Skip to content

Start-PodeStaticServer

SYNOPSIS

Helper wrapper function to start a Pode web server for a static website at the current directory.

SYNTAX

Start-PodeStaticServer [-Threads <Int32>] [-RootPath <String>] [-Address <String>] [-Port <Int32>] [-Https]
 [-Certificate <String>] [-CertificatePassword <String>] [-X509Certificate <X509Certificate>] [-Path <String>]
 [-Defaults <String[]>] [-DownloadOnly] [-Browse] [<CommonParameters>]

DESCRIPTION

Helper wrapper function to start a Pode web server for a static website at the current directory.

EXAMPLES

EXAMPLE 1

Start-PodeStaticServer

EXAMPLE 2

Start-PodeStaticServer -Address '127.0.0.3' -Port 8000

EXAMPLE 3

Start-PodeStaticServer -Path '/installers' -DownloadOnly

PARAMETERS

-Address

The IP/Hostname of the endpoint.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: Localhost
Accept pipeline input: False
Accept wildcard characters: False

-Browse

Open the web server's default endpoint in your default browser.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Certificate

The path to a certificate that can be use to enable HTTPS.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-CertificatePassword

The password for the certificate referenced in CertificateFile.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Defaults

An array of default pages to display, such as 'index.html'.

Type: String[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DownloadOnly

When supplied, all static content on this Route will be attached as downloads - rather than rendered.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Https

Start the server using HTTPS.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Path

The URI path for the static Route.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: /
Accept pipeline input: False
Accept wildcard characters: False

-Port

The Port number of the endpoint.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False

-RootPath

An override for the Server's root path.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $PWD
Accept pipeline input: False
Accept wildcard characters: False

-Threads

The numbers of threads to use for requests.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 3
Accept pipeline input: False
Accept wildcard characters: False

-X509Certificate

The raw X509 certificate that can be use to enable HTTPS.

Type: X509Certificate
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES