From 0d82cffd799b9ca456dd5df34e0130277d2801cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Wed, 29 Mar 2017 17:24:59 -0700 Subject: [PATCH] Add -web.prefix / WEB_PREFIX option This allows people to use unsee with a sub uri setup, which is pretty common usa case, fixes #22 --- README.md | 16 +++++++++ assets/templates/help.html | 6 ++-- assets/templates/index.html | 8 ++--- assets/templates/js.html | 28 +++++++-------- bindata_assetfs.go | 6 ++-- config/config.go | 1 + main.go | 26 ++++++++++---- views.go | 5 +++ views_test.go | 71 +++++++++++++++++++++++++++++++++++++ 9 files changed, 136 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index cf37c9759..53d526e06 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,22 @@ This option can also be set using `-strip.labels` flag. Example: This variable is optional and default is not set (all labels will be shown). +#### WEB_PREFIX + +URL root for unsee, you can use to if you wish to serve it from location other +than /. Examples: + + WEB_PREFIX=/unsee/ + +This will configure unsee to serve requests from http://localhost/unsee/ +instead http://localhost/. + +This option can also be set using `-web.prefix` flag. Example: + + $ unsee -web.prefix /unsee/ + +Default is `/`. + ## Contributing Please see [CONTRIBUTING](/CONTRIBUTING.md) for details. diff --git a/assets/templates/help.html b/assets/templates/help.html index 1bb8b185d..7f45b6c2a 100644 --- a/assets/templates/help.html +++ b/assets/templates/help.html @@ -13,9 +13,9 @@ (◕︵◕) {{ range .CSSFiles }} - {{- end }} + {{- end }} - + @@ -248,7 +248,7 @@