summaryrefslogtreecommitdiff
path: root/srv/src/http
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-20 17:04:20 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-20 17:04:20 -0600
commitb4ca8853a9085cb0231f2c4de25a1ec07ef150a0 (patch)
tree266efcf8611cc47aae235a011b7bb30d5b5499a7 /srv/src/http
parent1ffda21ae38d203e381bedbf7bdbbd69c9031062 (diff)
Update http config names
Diffstat (limited to 'srv/src/http')
-rw-r--r--srv/src/http/api.go8
-rw-r--r--srv/src/http/tpl.go2
2 files changed, 3 insertions, 7 deletions
diff --git a/srv/src/http/api.go b/srv/src/http/api.go
index 85a6375..ab0e972 100644
--- a/srv/src/http/api.go
+++ b/srv/src/http/api.go
@@ -32,10 +32,6 @@ type Params struct {
Logger *mlog.Logger
PowManager pow.Manager
- // PathPrefix, if given, will be prefixed to all url paths which are
- // rendered by the API's templating system.
- PathPrefix string
-
PostStore post.Store
PostAssetStore post.AssetStore
@@ -61,8 +57,8 @@ type Params struct {
// SetupCfg implement the cfg.Cfger interface.
func (p *Params) SetupCfg(cfg *cfg.Cfg) {
- cfg.StringVar(&p.ListenProto, "listen-proto", "tcp", "Protocol to listen for HTTP requests with")
- cfg.StringVar(&p.ListenAddr, "listen-addr", ":4000", "Address/path to listen for HTTP requests on")
+ cfg.StringVar(&p.ListenProto, "http-listen-proto", "tcp", "Protocol to listen for HTTP requests with")
+ cfg.StringVar(&p.ListenAddr, "http-listen-addr", ":4000", "Address/path to listen for HTTP requests on")
httpAuthUsersStr := cfg.String("http-auth-users", "{}", "JSON object with usernames as values and password hashes (produced by the hash-password binary) as values. Denotes users which are able to edit server-side data")
diff --git a/srv/src/http/tpl.go b/srv/src/http/tpl.go
index 62a4d06..dcd1551 100644
--- a/srv/src/http/tpl.go
+++ b/srv/src/http/tpl.go
@@ -35,7 +35,7 @@ func (a *api) parseTpl(tplBody string) (*template.Template, error) {
// filepath.Join strips trailing slash, but we want to keep it
trailingSlash := strings.HasSuffix(path, "/")
- path = filepath.Join("/", a.params.PathPrefix, path)
+ path = filepath.Join("/", path)
if trailingSlash && path != "/" {
path += "/"