]> Sergey Matveev's repositories - godlighty.git/blob - rc/example.cfg/lists.cypherpunks.ru.go
20b2e63192f616c26723b279738743855378b38a
[godlighty.git] / rc / example.cfg / lists.cypherpunks.ru.go
1 package cfg
2
3 import (
4         "net/http"
5         "path"
6         "strings"
7
8         "go.stargrave.org/godlighty"
9 )
10
11 func init() {
12         host := "lists.cypherpunks.ru"
13         godlighty.Hosts[host] = &godlighty.HostCfg{
14                 Root: path.Join(WWW, host),
15                 TLS:  newTLSCfg(host),
16                 Hooks: []godlighty.Hook{
17                         func(w http.ResponseWriter, r *http.Request) bool {
18                                 if strings.HasPrefix(r.URL.Path, "/archive/") {
19                                         r.URL.Path = strings.TrimPrefix(r.URL.Path, "/archive")
20                                         godlighty.MainHandler.Handle(w, r, host, &godlighty.HostCfg{
21                                                 Root: "/home/mlmmj/archive",
22                                         })
23                                         return true
24                                 }
25                                 return false
26                         },
27                 },
28         }
29 }