Serve media from drive via fully in-memory blob store
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
|
||||
"heliosian/internal/auth"
|
||||
"heliosian/internal/blob"
|
||||
"heliosian/internal/data"
|
||||
"heliosian/internal/directory"
|
||||
)
|
||||
@@ -72,6 +73,13 @@ func main() {
|
||||
mux := http.NewServeMux()
|
||||
authn.Register(mux)
|
||||
directory.Register(mux, cache)
|
||||
if os.Getenv("DIRECTORY_SHEET") != "" {
|
||||
store, err := blob.New()
|
||||
if err != nil {
|
||||
log.Fatalf("[ERROR] blob store: %v", err)
|
||||
}
|
||||
blob.Register(mux, store)
|
||||
}
|
||||
mux.Handle("GET /{$}", http.RedirectHandler("/people", http.StatusFound))
|
||||
mux.Handle("GET /static/", http.StripPrefix("/static/", http.FileServer(http.Dir("web/static"))))
|
||||
port := os.Getenv("PORT")
|
||||
|
||||
Reference in New Issue
Block a user