r/PowerShell • u/Badgerati • Feb 04 '20
Pode - PowerShell Web Server
I've been meaning to post about this on here for a while, so thought a new release would be a good time!
Pode is a cross-platform pure PowerShell Web Server - even HTTPS. There's also support for template engines in views, and even Azure Functions and AWS Lambda support.
Pode lets you build fully custom REST APIs and Websites, with support for Routing, Middleware, Sessions, CSRF, Authentication, and even Web Sockets.
You can run Pode on Windows or Linux, as a Windows/Linux service, in a Docker container, or even on a Raspberry Pi!
The latest release, v1.5.0, now adds OpenAPI and Swagger/ReDoc support.
You can find Pode on [Github] with a full list of features, and the documentation here.
I know some people frown at the idea of PowerShell as a Web Server, but for DevOps Automation and Dashboards it can be quite a useful tool to have! :)
3
u/SupremeDictatorPaul Feb 05 '20
Very cool. I wrote a multi threaded web server in PowerShell (PEWebServer) around 2 years ago. I took inspiration from Polaris and PSWebServer, and I’m sad I couldn’t pull some from yours.
Mine was for the very niche case of running in Windows PE. For some reason, http.sys says it’s not licensed for WinPE, so the HttpListener class is not available. I had to use a a raw TCP socket and built my own HTTP parser/generator to recreate the HttpListener class. Because they weren’t needed, I didn’t implement encryption or authentication (and wow would doing TLS have been insane).
In any case, it’s incredible how useful and flexible a web server written in PowerShell can be.