summaryrefslogtreecommitdiffstats
path: root/roseh.moe.go
diff options
context:
space:
mode:
Diffstat (limited to 'roseh.moe.go')
-rw-r--r--roseh.moe.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/roseh.moe.go b/roseh.moe.go
index b8758a4..c831b01 100644
--- a/roseh.moe.go
+++ b/roseh.moe.go
@@ -45,6 +45,7 @@ var (
configFile = flag.String("config", "config.xml", "configuration file (XML, baby!!)")
https = flag.String("https", "", "directory containing cert.pem and key.pem, or empty string to use unencrypted http")
holeTempDir = flag.String("hole-temp-dir", "hole", "directory to store temporary files for the wormhole")
+ codeDir = flag.String("code-dir", "code", "directory to serve git repos")
serverStartTime = time.Now()
)
@@ -814,6 +815,7 @@ func main() {
}()
mux := http.NewServeMux()
+ mux.HandleFunc("GET /{$}", index)
mux.HandleFunc("GET /pong", pong)
mux.HandleFunc("GET /qr.png", qrHandler)
mux.HandleFunc("GET /wormhole", wormhole)
@@ -825,9 +827,9 @@ func main() {
mux.HandleFunc("POST /notepad", autosave)
mux.HandleFunc("GET /cmd/{cmd}", cmd)
mux.HandleFunc("GET /pkg/{pkg}", pkg)
+ mux.Handle("GET /code/", http.StripPrefix("/code/", http.FileServer(http.Dir(*codeDir))))
mux.HandleFunc("GET /static/", static)
mux.HandleFunc("GET /favicon.ico", favicon)
- mux.HandleFunc("GET /{$}", index)
mux.HandleFunc("GET /", notFound)
http.Handle("/", http.NewCrossOriginProtection().Handler(mux))
jellyfinURL, err := url.Parse("http://127.0.0.1:8096")