Skip to content
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

Helper function to more easily make GET Routes #344

Closed
Badgerati opened this issue Aug 22, 2019 · 0 comments · Fixed by #345
Closed

Helper function to more easily make GET Routes #344

Badgerati opened this issue Aug 22, 2019 · 0 comments · Fixed by #345

Comments

@Badgerati
Copy link
Owner

Another helper function for creating routes more easily, similar to ConvertTo-PodeRoute; this one is Add-PodePage and will only generate HTML GET Routes.

For example:

Add-PodePage -Name Service -ScriptBlock { Get-Service }

is a more simplified version of:

Add-PodeRoute -Method Get -Path '/Services' -ScriptBlock {
    Write-PodeHtmlResponse -Value (Get-Service)
}

This could also have support for -File and -View, and like ConvertTo-PodeRoute should also support -Middleware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant