Updated 2016-02-06 03:23:46 by JSB

EmberWeb is small and simple web framework based off the Dustmote code. It's TCL only and is being written for use on small systems like the Raspberry Pi, but does not exclude use on larger systems.

The code is hosted at:

https://github.com/jscottb/emberweb

Here is a small example:
package require emberweb 1.0
package require Tcl      8.5

proc forward {soc parms} {
   puts "in Forward"
   puts $soc "HTTP/1.0 [::emberweb::http_return 200]"
   puts $soc "Connection: close"
   puts $soc ""
   close $soc
}

proc backward {soc parms} {
   puts "in Backward"
   puts $soc "HTTP/1.0 [::emberweb::http_return 200]"
   puts $soc "Connection: close"
   puts $soc ""
   close $soc
}
proc left {soc parms} {
   puts "in Left"
   puts $soc "HTTP/1.0 [::emberweb::http_return 200]"
   puts $soc "Connection: close"
   puts $soc ""
   close $soc
}
proc right {soc parms} {
   puts "in Right"
   puts $soc "HTTP/1.0 [::emberweb::http_return 200]"
   puts $soc "Connection: close"
   puts $soc ""
   close $soc
}

# Register a few call uri handlers
::emberweb::addRoute {/forward} forward
::emberweb::addRoute {/backward} backward
::emberweb::addRoute {/left} left
::emberweb::addRoute {/right} right

# Start the server up and set your port, WWW html pages home and images home.
::emberweb::run 8080 "c:/home/www/templates" \
                     "c:/home/www/images"