-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
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
Adds a -FilePath parameter to the RouteGroup functions #1331
base: develop
Are you sure you want to change the base?
Conversation
add filepath to PodeRouteGroup
You should do the same with Add-PodeSignalRouteGroup. |
I will update it then... don't merge it yet :D |
This one is added now! 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good :)
Akin to the Add-PodeSignalRouteGroup
above, the Add-PodeStaticRouteGroup
will also need the same too.
It'll also be worth adding a quick mention to the new parameter in the docs at /docs/Tutorials/Routes/Utilities/RouteGrouping.md
. At the bottom of the ## Routes
section, a quick nod the the -FilePath
parameter and an example will do 😄
The commit refactors the `Add-PodeRouteGroup`, `Add-PodeStaticRouteGroup`, and `Add-PodeSignalRouteGroup` functions to use the default parameter set for routes. This change allows for a more concise and consistent code structure. Additionally, it adds support for specifying a file path when adding route groups. - Set the default parameter set to 'Routes' in `[CmdletBinding()]` - Update the mandatory parameter attribute for `$Routes` in each function - Add a new parameter, `$FilePath`, with mandatory attribute and 'File' parameter set in each function - Modify the logic to check if `$Routes` is empty and handle it accordingly Examples: ``` Add-PodeRouteGroup -Path '/api' -Routes { Add-PodeRoute -Path '/route1' -Etc } Add-PodeRouteGroup -Path '/api' -FilePath '/routes/file.ps1' Add-PodeStaticRouteGroup -Path '/static' -Routes { Add-PodeStaticRoute -Path '/images' -Etc } Add-PodeStaticRouteGroup -Path '/static' -FilePath '/routes/file.ps1' Add-PodeSignalRouteGroup -Path '/signals' -Routes { Add-PodeSignalRoute -Path '/signal1' } Add-PodeSignalRouteGroup -Path '/api'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some documentation to be added 😄
|
||
[Parameter(Mandatory = $true, ParameterSetName = 'File')] | ||
[string] | ||
$FilePath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This -FilePath
parameter is missing the .PARAMETER
definition above the function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the new -FilePath
parameter, it'd be worth adding a quick mention of the parameter in the docs found at /docs/Tutorials/Routes/Utilities/RouteGrouping.md
. At the bottom of the ## Routes
section, a quick nod the the -FilePath
parameter and an example will do 😄
I will fix them, sorry for the late response, I don't get notifications from Github... checking what is going on there . |
Description of the Change
Add Filepath parameter to the command PodeRouteGroup
Related Issue
A link/reference to the GitHub issue.