|
@@ -30,7 +30,7 @@ import (
|
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
|
|
- "gopkg.in/macaron.v1"
|
|
|
|
|
|
|
+ macaron "gopkg.in/macaron.v1"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
func init() {
|
|
@@ -227,6 +227,10 @@ func (hs *HTTPServer) addMiddlewaresAndStaticRoutes() {
|
|
|
|
|
|
|
|
m.Use(middleware.AddDefaultResponseHeaders())
|
|
m.Use(middleware.AddDefaultResponseHeaders())
|
|
|
|
|
|
|
|
|
|
+ if setting.ServeFromSubPath && setting.AppSubUrl != "" {
|
|
|
|
|
+ m.SetURLPrefix(setting.AppSubUrl)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
m.Use(macaron.Renderer(macaron.RenderOptions{
|
|
m.Use(macaron.Renderer(macaron.RenderOptions{
|
|
|
Directory: path.Join(setting.StaticRootPath, "views"),
|
|
Directory: path.Join(setting.StaticRootPath, "views"),
|
|
|
IndentJSON: macaron.Env != macaron.PROD,
|
|
IndentJSON: macaron.Env != macaron.PROD,
|