Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description
                                               __  
  _      ___      ___      ______  ____  _____/ /_ 
 | | /| / / | /| / / | /| / / __ \/ __ \/ ___/ __ \
 | |/ |/ /| |/ |/ /| |/ |/ / /_/ / /_/ (__  ) / / /
 |__/|__/ |__/|__/ |__/|__/\____/\____/____/_/ /_/

A simple HTTP/CGI server written in shell

docker run -it -p 8080:8080 tropicloud/wwwoosh

(martin)

A sinatra-like web application framework for Bash, with a CGI interface.

Example app:

# load the framework and define handlers
. martin.sh 

GET "/" root_handler
root_handler () {
    header "Content-Type" "text/html"
    cat "index.html"
}

GET "/ps" ps_handler
ps_handler () {
    header "Content-Type" "text/plain"
    ps aux
}

GET "/redirect" redirect_handler
redirect_handler () {
    status 302
    header "Location" "https://github.com/" 
}

# run app using the wwwoosh server
wwwoosh_run martin_dispatch 8080

Note!

Hopefully it's obvious, but these projects are for fun and not meant to be taken seriously. Wwwoosh can only handle about 2 request per second (any additional fail completely), not to mention there's probably some pretty nasty security issues with it.

It is, however, a testament to the simplicity of HTTP, and the power of Unix Shell.

Docker Pull Command
Owner
tropicloud
Source Repository

Comments (0)