Posted to tcl by colin at Mon Oct 21 19:59:17 GMT 2013view raw

  1. set wub [pwd] ;# set according to your system
  2.  
  3. lappend ::auto_path $wub/Wub $wub/Utilities $wub/extensions
  4. package require Debug
  5. Debug on error 100
  6. Debug on log 10
  7.  
  8. package require Dict
  9.  
  10. package require Httpd
  11. package require Listener
  12. proc Site {args} {}
  13. proc Block {args} {return 0}
  14. proc UA {args} {}
  15. proc Cache {args} {return {}}
  16.  
  17. namespace eval ::Dispatcher {
  18. proc pre {r} {return $r}
  19. proc post {r} {return $r}
  20. proc do {op r} {
  21. return [Http Ok $r "<h1>Got it</h1>" text/html]
  22. }
  23. }
  24.  
  25. Listener new
  26.  
  27. #...
  28.  
  29. vwait forever