Home

Awesome

coms

A simple Windows web server in 10 lines of powershell

Alt text

Usage

./coms.ps1 [port] [response]

Frequently Asked Questions

Is this for real?

Indeed. And we ensured that it will only work on Machines using Microsoft Windows

How do I install it?

You don't have to. Clone the repository or grab the raw content in a file then execute it using Powershell

Is this a thread based server, or does it use an event loop instead?

It.. well.. if.. No.

How do I define routes?

How should I know?

What content types are supported?

Anything you can pressfit into a StreamWriter.

Does it work on Unix?

What doesn't run on Unix?

What about Mono?

What about it?


Statement from the Author

I found a really interesting Repository via /r/coolgithubprojects/ called /benrady/shinatra the "web server in five lines of bash" which at first left me wondering "Can it be done on Windows?" but then I saw what I felt was a snarky remark about Windows and since then I was on a Mission.

Now - two Days later this is my finished work. Take it for what it is - probably satire.

I would have loved to replicate the same concise shell script in cmd or at least powershell but I could not so I accept my defeat.

From 17 to 10

ChristopherGLewis unraveled the Mysteries of the HttpListener and brought us a Solution in 10 LoC while even managing to stay alive for a second request. Please see his repositories for more iterations and versions of the Script.