diff options
author | alekseiplusplus <alekseijeaves@protonmail.com> | 2024-06-30 14:48:13 +1000 |
---|---|---|
committer | alekseiplusplus <alekseijeaves@protonmail.com> | 2024-06-30 14:48:13 +1000 |
commit | d5cc926ec6c3020d2d51cacc7d14e59c558c4167 (patch) | |
tree | 7dbc071ee3ecd6c143426984c19b4c73c11a42c7 /http.tcl | |
parent | a61f03cfbf62eb006e6bd845694f18d40101d4e8 (diff) |
beginning draftwork on modules
Diffstat (limited to 'http.tcl')
-rwxr-xr-x | http.tcl | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ # From configuration -# root Directory which files reside in. +# srv Directory which files reside in. namespace eval http { @@ -41,7 +41,7 @@ namespace eval http { proc server {channel address port} { variable hook_namespace; - variable root; + variable srv; ## (1) Handle first line puts "(1)" @@ -80,7 +80,7 @@ namespace eval http { ## (3) Find if the file exists, or there is a hooked application. # If file exists, then 200 OK! - set filename [string cat $root [request_target::file $request_target]] + set filename [string cat $srv [request_target::file $request_target]] if [expr [file exists $filename] && [file isfile $filename]] { respond $channel 200 $filename } elseif [expr [file exists [string cat $filename "index.html"]] && [file isfile [string cat $filename "index.html"]]] { @@ -121,7 +121,7 @@ namespace eval http { proc respond {channel status {optional {}}} { ## Import Variables - variable root; + variable srv; variable status_codes; variable hook_namespace; ## New Variables |