-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.tcl
More file actions
executable file
·31 lines (26 loc) · 913 Bytes
/
example.tcl
File metadata and controls
executable file
·31 lines (26 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/tclsh8.6
# change the above line to point to the tclsh8.6 executable
lappend auto_path .
package require wibble
# =============================== example code ================================
# Demonstrate Wibble if being run directly.
if {$argv0 eq [info script]} {
# Guess the root directory.
set root [file normalize [file dirname [info script]]]
# Define zone handlers.
::wibble::handle /vars vars
::wibble::handle / dirslash root $root
::wibble::handle / indexfile root $root indexfile index.html
::wibble::handle / static root $root
::wibble::handle / template root $root
::wibble::handle / script root $root
::wibble::handle / dirlist root $root
::wibble::handle / notfound
# Start a server and enter the event loop if not already there.
catch {
::wibble::listen 8080
if {!$tcl_interactive} {
vwait forever
}
}
}