You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Simple implementation of a HTTP server to be used by the updater with the http source
2
+
package main
3
+
4
+
import (
5
+
"flag"
6
+
"log"
7
+
"net/http"
8
+
"path"
9
+
"time"
10
+
)
11
+
12
+
funcmain() {
13
+
varroot, listen, prefix, fixedSlugstring
14
+
flag.StringVar(&root, "repo", "", "Root path of the file server")
15
+
flag.StringVar(&listen, "listen", "localhost:9947", "IP address and port used for the HTTP server")
16
+
flag.StringVar(&prefix, "path-prefix", "/repo", "Prefix to the root path of the HTTP server")
17
+
flag.StringVar(&fixedSlug, "fixed-slug", "creativeprojects/resticprofile", "Only answer on this particular slug. When NOT specified the files will be served with the slug in the path.")
18
+
flag.Parse()
19
+
20
+
mux:=http.NewServeMux()
21
+
fs:=http.FileServer(http.Dir(root))
22
+
pathPrefix:=path.Join("/", prefix, fixedSlug)
23
+
log.Printf("listening on http://"+listen+pathPrefix)
0 commit comments