refactor(web): create /tfm directory for TFM pages
This commit is contained in:
@@ -175,7 +175,10 @@ func main() {
|
||||
}
|
||||
public_fs := http.FileServer(http.Dir("/srv/www/tanabata"))
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/" && path.Ext(r.URL.Path) == "" {
|
||||
if r.URL.Path == "/tfm" {
|
||||
r.URL.Path += "/"
|
||||
}
|
||||
if r.URL.Path[len(r.URL.Path)-1] != '/' && path.Ext(r.URL.Path) == "" {
|
||||
r.URL.Path += ".html"
|
||||
}
|
||||
public_fs.ServeHTTP(w, r)
|
||||
|
||||
Reference in New Issue
Block a user