# Exprash An Express-like HTTP router for Bash compatible with CGI 1.1 I'm aware that the name of this project evokes a feeling of physical disgust. That is by design. ## Usage/Examples Here is some leaked source code for my brand new Cat website. Do not steal! ```shell #!/bin/bash source exprash.sh; redirect_stdout 'log'; declare -A cats; cats[calico]="Calico"; cats[sphynx]="Sphynx"; cats[ragdoll]="Ragdoll"; cats[holland_lop]="Holland Lop"; cats[scottish_fold]="Scottish Fold"; cats[orange]="Orange"; get '/' && { html='

Cats

'; printf '%s' "$html" | send; } get '/cats/:cat' && { key=$(param 'cat'); if [[ -v "cats[$key]" ]]; then if [ "$key" == 'holland_lop' ]; then next "That's not a cat!"; else printf '

Your Cat: %s

\n' "${cats[$key]}" | send; fi; else next; fi; } get '/cats/*' && { printf '

Error: Cannot find that cat

\n' | send; } get_error '/cats/*' && { printf '

%s

' "$(get_error_message)" | send; } (use || use_error) && { printf '

404

' | send; } ``` ## License [WTFPL](http://www.wtfpl.net/txt/copying/)