Pode icon indicating copy to clipboard operation
Pode copied to clipboard

Multiple Methods support on Routes

Open Badgerati opened this issue 3 years ago • 0 comments

Describe the Change

Add support on Add-PodeRoute for multiple values on -Method to be supplied, making it easier to create a Route that works on multiple Methods - much like how -EndpointName works.

For example, this will create a [GET] /users and [POST] /users route, that share a scriptblock:

Add-PodeRoute -Method Get, Post -Path '/users' -ScriptBlock {}

If you need to know the method used, then it will be in $WebEvent.Method in the scriptblock.

Badgerati avatar Jun 28 '22 20:06 Badgerati