You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a reason why static routes are checked before any non-static ones?
The question is related to this sample: ( $directoryPath is the PodePath)
# Start Pode serverStart-PodeServer-ScriptBlock {
Add-PodeEndpoint-Address localhost -Port 8080-Protocol Http -Default
Add-PodeRoute-Method Get -Path '/LICENSE.txt'-ScriptBlock {
$value=@"Don't be kidding. Nobody will believe that you want to read this legalise nonsense.I want to be kind; this is a summary of the content:Nothing to report :D"@Write-PodeTextResponse-Value $value
}
Add-PodeStaticRouteGroup-FileBrowser -Routes {
Add-PodeStaticRoute-Path '/'-Source $using:directoryPath-FileBrowser
}
}
in theory, the code should hide the LICENSE.TXT file, but today, this code is not working because Static routes are checked before
anything else.
It is a problem if we switch the order Static->Anything else to Anything else ->Static. Or at least make this configurable.
I did some tests and cannot see any side effects from changing that.
Is there a reason why static routes are checked before any non-static ones?
The question is related to this sample: ( $directoryPath is the PodePath)
in theory, the code should hide the LICENSE.TXT file, but today, this code is not working because Static routes are checked before
anything else.
It is a problem if we switch the order
Static->Anything else
toAnything else ->Static
. Or at least make this configurable.I did some tests and cannot see any side effects from changing that.
@Badgerati, what are your thoughts?
Thanks
The text was updated successfully, but these errors were encountered: