From f4bf2e9c8d6b9877b2ee2e5772b8f78b6f71a036 Mon Sep 17 00:00:00 2001 From: Joachim Bauch Date: Tue, 18 Mar 2014 10:26:38 +0100 Subject: [PATCH] Load buddy images from "static" subfolder. --- src/app/spreed-speakfreely-server/main.go | 2 +- static/js/services/buddylist.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/spreed-speakfreely-server/main.go b/src/app/spreed-speakfreely-server/main.go index 62d2bc35..6ae8a977 100644 --- a/src/app/spreed-speakfreely-server/main.go +++ b/src/app/spreed-speakfreely-server/main.go @@ -319,12 +319,12 @@ func runner(runtime phoenix.Runtime) error { router := mux.NewRouter() r := router.PathPrefix(basePath).Subrouter().StrictSlash(true) r.HandleFunc("/", httputils.MakeGzipHandler(mainHandler)) + r.Handle("/static/img/buddy/{imageid}/{idx:.*}", http.StripPrefix(basePath, makeImageHandler(hub, time.Hour))) r.Handle("/static/{path:.*}", http.StripPrefix(basePath, httputils.FileStaticServer(http.Dir(rootFolder)))) r.Handle("/robots.txt", http.StripPrefix(basePath, http.FileServer(http.Dir(path.Join(rootFolder, "static"))))) r.Handle("/favicon.ico", http.StripPrefix(basePath, http.FileServer(http.Dir(path.Join(rootFolder, "static", "img"))))) r.Handle("/ws", makeWsHubHandler(hub)) r.HandleFunc("/{room}", httputils.MakeGzipHandler(roomHandler)) - r.Handle("/img/buddy/{imageid}/{idx:.*}", http.StripPrefix(basePath, makeImageHandler(hub, time.Hour))) // Add API end points. api := sleepy.NewAPI(r.PathPrefix("/api/v1/").Subrouter()) diff --git a/static/js/services/buddylist.js b/static/js/services/buddylist.js index 4efa779e..0f8cd71e 100644 --- a/static/js/services/buddylist.js +++ b/static/js/services/buddylist.js @@ -323,7 +323,7 @@ define(['underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text! // can use data: urls directly return url; } else if (url.indexOf("img:") === 0) { - return mediaStream.config.B + "img/buddy/"+url.substr(4); + return mediaStream.config.B + "static/img/buddy/"+url.substr(4); } console.log("Unknown buddy picture url", url);