Skip to content

Commit

Permalink
Tests are Ok, Docs are Ok. Close issue Badgerati#1329
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyas Lambrechts committed Jun 7, 2024
1 parent 4ccf76a commit 824c999
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/Public/Routes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1095,8 +1095,13 @@ An Array of strings representing the unique tag for the API specification.
This tag helps in distinguishing between different versions or types of API specifications within the application.
You can use this tag to reference the specific API documentation, schema, or version that your function interacts with.
.PARAMETER FilePath
A literal, or relative, path to a file containing a ScriptBlock for the Route's main logic.
.EXAMPLE
Add-PodeRouteGroup -Path '/api' -Routes { Add-PodeRoute -Path '/route1' -Etc }
.EXAMPLE
Add-PodeRouteGroup -Path '/api' -FilePath '/routes/file.ps1'
#>
function Add-PodeRouteGroup {
[CmdletBinding()]
Expand Down Expand Up @@ -1171,15 +1176,16 @@ function Add-PodeRouteGroup {
$FilePath
)



if (Test-PodeIsEmpty $Routes) {
if ($PSCmdlet.ParameterSetName -ieq 'file') {
$Routes = Convert-PodeFileToScriptBlock -FilePath $FilePath
}else{

throw 'No scriptblock for -Routes passed'
}
if ($PSCmdlet.ParameterSetName -ieq 'file') {
$Routes = Convert-PodeFileToScriptBlock -FilePath $FilePath
}
else {

throw 'No scriptblock for -Routes passed'
}
}

if ($Path -eq '/') {
Expand Down

0 comments on commit 824c999

Please sign in to comment.