Skip to content

Start-PodeServer

SYNOPSIS

Starts a Pode Server with the supplied ScriptBlock.

SYNTAX

Script (Default)

Start-PodeServer [-ScriptBlock] <ScriptBlock> [-Interval <Int32>] [-Name <String>] [-Threads <Int32>]
 [-RootPath <String>] [-Request <Object>] [-ServerlessType <String>] [-StatusPageExceptions <String>]
 [-ListenerType <String>] [-DisableTermination] [-Quiet] [-Browse] [<CommonParameters>]

File

Start-PodeServer -FilePath <String> [-Interval <Int32>] [-Name <String>] [-Threads <Int32>]
 [-RootPath <String>] [-Request <Object>] [-ServerlessType <String>] [-StatusPageExceptions <String>]
 [-ListenerType <String>] [-DisableTermination] [-Quiet] [-Browse] [-CurrentPath] [<CommonParameters>]

DESCRIPTION

Starts a Pode Server with the supplied ScriptBlock.

EXAMPLES

EXAMPLE 1

Start-PodeServer { /* logic */ }

EXAMPLE 2

Start-PodeServer -Interval 10 { /* logic */ }

EXAMPLE 3

Start-PodeServer -Request $LambdaInput -ServerlessType AwsLambda { /* logic */ }

PARAMETERS

-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

-CurrentPath

Sets the Server's root path to be the current working path - for -FilePath only.

Type: SwitchParameter
Parameter Sets: File
Aliases:

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

-DisableTermination

Disables the ability to terminate the Server.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-FilePath

A literal, or relative, path to a file containing a ScriptBlock for the Server's logic. The directory of this file will be used as the Server's root path - unless a specific -RootPath is supplied.

Type: String
Parameter Sets: File
Aliases:

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

-Interval

For 'Service' type Servers, will invoke the ScriptBlock every X seconds.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-ListenerType

{{ Fill ListenerType Description }}

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: [string]::Empty
Accept pipeline input: False
Accept wildcard characters: False

-Name

An optional name for the Server (intended for future ideas).

Type: String
Parameter Sets: (All)
Aliases:

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

-Quiet

Disables any output from the Server.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Request

Intended for Serverless environments, this is Requests details that Pode can parse and use.

Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
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: None
Accept pipeline input: False
Accept wildcard characters: False

-ScriptBlock

The main logic for the Server.

Type: ScriptBlock
Parameter Sets: Script
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ServerlessType

Optional, this is the serverless type, to define how Pode should run and deal with incoming Requests.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: [string]::Empty
Accept pipeline input: False
Accept wildcard characters: False

-StatusPageExceptions

An optional value of Show/Hide to control where Stacktraces are shown in the Status Pages. If supplied this value will override the ShowExceptions setting in the server.psd1 file.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: [string]::Empty
Accept pipeline input: False
Accept wildcard characters: False

-Threads

The numbers of threads to use for Web and TCP servers.

Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 1
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