blob: 8c90db73befde9bca6f0f5be6a8eac13fae3c6c3 (
plain)
1
2
3
4
5
6
7
8
9
|
Wish the web server handles route {/printed-programs/(\d+)\.folk$} with handler {
regexp {/printed-programs/(\d+)\.folk$} $path -> id
set filename "../folk-printed-programs/$id.folk"
set fp [open $filename r]
set data [read $fp]
close $fp
dict create statusAndHeaders "HTTP/1.1 200 OK\nConnection: close\nContent-Type: text/plain; charset=utf-8\n\n" body $data
}
|