Add PodeStaticRoute - mdaneri/Pode GitHub Wiki
Add a static Route for rendering static content.
Add-PodeStaticRoute [-Path] <String> [-Source] <String> [[-Middleware] <Object[]>] [[-EndpointName] <String[]>]
[[-ContentType] <String>] [[-TransferEncoding] <String>] [[-Defaults] <String[]>]
[[-ErrorContentType] <String>] [[-Authentication] <String>] [[-Access] <String>] [[-IfExists] <String>]
[[-Role] <String[]>] [[-Group] <String[]>] [[-Scope] <String[]>] [[-User] <String[]>] [-AllowAnon]
[-DownloadOnly] [-FileBrowser] [-PassThru] [-RedirectToDefault] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Add a static Route for rendering static content. You can also define default pages to display.
Add-PodeStaticRoute -Path '/assets' -Source './assets'
Add-PodeStaticRoute -Path '/assets' -Source './assets' -Defaults @('index.html')
Add-PodeStaticRoute -Path '/installers' -Source './exes' -DownloadOnly
Add-PodeStaticRoute -Path '/assets' -Source './assets' -Defaults @('index.html') -RedirectToDefault
The name of an Access method which should be used as middleware on this Route.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 10
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the static route 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: FalseThe name of an Authentication method which should be used as middleware on this Route.
Type: String
Parameter Sets: (All)
Aliases: Auth
Required: False
Position: 9
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe content type the static Route should use when parsing any payloads.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAn array of default pages to display, such as 'index.html'.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 7
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseWhen 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: FalseThe EndpointName of an Endpoint(s) to bind the static Route against.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe content type of any error pages that may get returned.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 8
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, when the path is a folder, instead of returning 404, will return A browsable content of the directory.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseOne or more optional Groups that will be authorised to access this Route, when using Authentication with an Access method.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 13
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies what action to take when a Static Route already exists. (Default: Default)
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 11
Default value: Default
Accept pipeline input: False
Accept wildcard characters: FalseAn array of ScriptBlocks for optional Middleware.
Type: Object[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the static route created will be returned so it can be passed through a pipe.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThe URI path for the static Route.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseIf supplied, the user will be redirected to the default page if found instead of the page being rendered as the folder path.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseOne or more optional Roles that will be authorised to access this Route, when using Authentication with an Access method.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 12
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOne or more optional Scopes that will be authorised to access this Route, when using Authentication with an Access method.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 14
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe literal, or relative, path to the directory that contains the static content.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe transfer encoding the static Route should use when parsing any payloads.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOne or more optional Users that will be authorised to access this Route, when using Authentication with an Access method.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: 15
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.