Skip to content

Add-PodeStaticRouteGroup

SYNOPSIS

Add a Static Route Group for multiple Static Routes.

SYNTAX

Add-PodeStaticRouteGroup [[-Path] <String>] [[-Source] <String>] [-Routes] <ScriptBlock>
 [[-Middleware] <Object[]>] [[-EndpointName] <String[]>] [[-ContentType] <String>]
 [[-TransferEncoding] <String>] [[-Defaults] <String[]>] [[-ErrorContentType] <String>]
 [[-Authentication] <String>] [-AllowAnon] [-DownloadOnly] [<CommonParameters>]

DESCRIPTION

Add a Static Route Group for sharing values between multiple Static Routes.

EXAMPLES

EXAMPLE 1

Add-PodeStaticRouteGroup -Path '/static' -Routes { Add-PodeStaticRoute -Path '/images' -Etc }

PARAMETERS

-AllowAnon

If supplied, the Static Routes will allow anonymous access for non-authenticated users.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Authentication

The name of an Authentication method which should be used as middleware on the Static Routes.

Type: String
Parameter Sets: (All)
Aliases: Auth

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

-ContentType

The content type to use for the Static Routes, when parsing any payloads.

Type: String
Parameter Sets: (All)
Aliases:

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

-Defaults

An array of default pages to display, such as 'index.html', for each Static Route.

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

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

-DownloadOnly

When supplied, all static content on the Routes 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

-EndpointName

The EndpointName of an Endpoint(s) to use for the Static Routes.

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

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

-ErrorContentType

The content type of any error pages that may get returned.

Type: String
Parameter Sets: (All)
Aliases:

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

-Middleware

An array of ScriptBlocks for optional Middleware to give each Static Route.

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

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

-Path

The URI path to use as a base for the Static Routes.

Type: String
Parameter Sets: (All)
Aliases:

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

-Routes

A ScriptBlock for adding Static Routes.

Type: ScriptBlock
Parameter Sets: (All)
Aliases:

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

-Source

A literal, or relative, base path to the directory that contains the static content, that should be prepended.

Type: String
Parameter Sets: (All)
Aliases:

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

-TransferEncoding

The transfer encoding to use for the Static Routes, when parsing any payloads.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 7
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

Back to top