2024-05-17 20:46:34 +03:00
|
|
|
fmt := import("fmt")
|
|
|
|
paths := import("paths")
|
|
|
|
htmExt := func(c){
|
2024-05-22 13:16:07 +03:00
|
|
|
if c.is_compo {
|
|
|
|
return
|
|
|
|
}
|
2024-05-17 20:46:34 +03:00
|
|
|
c.pp.print(`
|
|
|
|
</body></html>
|
|
|
|
`)
|
|
|
|
}
|
|
|
|
|
|
|
|
exts := {
|
|
|
|
".htm": htmExt,
|
|
|
|
".html": htmExt
|
|
|
|
}
|
|
|
|
|
|
|
|
export func(c){
|
|
|
|
url_path := c.http.request.url.path
|
|
|
|
ext := paths.ext(url_path)
|
|
|
|
|
|
|
|
cl := exts[ext]
|
|
|
|
if !is_undefined(cl) {
|
|
|
|
cl(c)
|
|
|
|
}
|
|
|
|
}
|