We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is the following possible on any way?
Server.ps1
Add-PodeRouteGroup -Path '/network' -FilePath './Routes/File.ps1'
File.ps1
{ Add-PodeRoute -Method Get -Path '/domains' -ScriptBlock { $result = vsz-getdomains | ConvertTo-Json Write-PodeJsonResponse -Value $result } Add-PodeRoute -Method Get -Path '/zones' -ScriptBlock { $result = vsz-getzones | ConvertTo-Json Write-PodeJsonResponse -Value $result } Add-PodeRoute -Method Get -Path '/zones/:zoneId/wlans' -ScriptBlock { $result = vsz-getwlans $WebEvent.Parameters['zoneId']| ConvertTo-Json $specificWlan = $result | Where-Object { $_.ZoneID -eq $WebEvent.Query['wlandId'] } if($null -eq $specificWlan) { Write-PodeJsonResponse -Value $result }else{ Write-PodeJsonResponse -Value $specificWlan } } Add-PodeRoute -Method Get -Path '/zones/:zoneId/dpsks' -ScriptBlock { $result = vsz-getdpsks $WebEvent.Parameters['zoneId']| ConvertTo-Json $specificWlan = $result | Where-Object { $_.ZoneID -eq $WebEvent.Query['dpsk'] } if($null -eq $specificWlan) { Write-PodeJsonResponse -Value $result }else{ Write-PodeJsonResponse -Value $specificWlan } } Add-PodeRoute -Method Post -Path '/zones/:zoneId/dpsks' -ScriptBlock { try{ $result = vsz-createdpsks -zoneID $WebEvent.Parameters['zoneId'] -wlanID $WebEvent.Data.wlandID -username $WebEvent.Data.username -userrole $WebEvent.Data.userrole Write-PodeTextResponse -Value $result -ContentType "application/json" } catch{ Write-PodeErrorLog -Exception $_.Exception Write-PodeJsonResponse -Value @{"message" = $_.Exception.Message} -StatusCode 500 } } }
The text was updated successfully, but these errors were encountered:
Tests are Ok, Docs are Ok. Close issue Badgerati#1329
824c999
Merge branch 'develop' into Issue-Badgerati#1329
6e69777
8c745f1
eltyBelgium
Successfully merging a pull request may close this issue.
Question
Is the following possible on any way?
Server.ps1
File.ps1
The text was updated successfully, but these errors were encountered: