Pode is a Cross-Platform PowerShell framework that allows you to host REST APIs, Web Pages and SMTP/TCP servers. It also allows you to render dynamic files using Pode files, which is effectively embedded PowerShell, or other Third-Party template engines.
All documentation and tutorials for Pode can be found here - this documentation will be for the latest release.
To see the docs for other releases, branches or tags, you can host the documentation locally. To do so you'll need to have the Invoke-Build
module installed; then:
Invoke-Build Docs
Then navigate to http://127.0.0.1:8000
in your browser.
Below is a quick example of using Pode to create a single REST API endpoint to return a JSON response. It will listen on a port, create the route, and respond with JSON when http://localhost:8080/ping
is hit:
Server {
listen *:8080 http
route get '/ping' {
json @{ 'value' = 'pong' }
}
}
See here for building your first app!
- Can run on *nix environments using PowerShell Core
- Host REST APIs, Web Pages, Static Content, TCP and SMTP server
- Multiple threads can be used to response to incoming requests
- Inbuilt template engine, with support for third-parties
- Setup async timers to be used as one off tasks, or for housekeeping services
- Ability to schedule async tasks using cron expressions
- Supports logging to CLI, Files, and custom loggers to other services like LogStash, etc.
- Cross-state variable access across multiple runspaces
- Optional file monitoring to trigger internal server restart on file changes
- Ability to allow/deny requests from certain IP addresses and subnets
- Basic rate limiting for IP addresses and subnets
- Support for generating/binding self-signed certificates, and signed certificates on Windows
- Support for middleware and sessions on web servers
- Can use authentication on requests, which can either be sessionless or session persistent
You can install Pode from either Chocolatey, the PowerShell Gallery, or Docker:
# chocolatey
choco install pode
# powershell gallery
Install-Module -Name Pode
# docker
docker pull badgerati/pode