summaryrefslogtreecommitdiff
path: root/src/http/http.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/http.go')
-rw-r--r--src/http/http.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/http/http.go b/src/http/http.go
index 6458416..6e57a77 100644
--- a/src/http/http.go
+++ b/src/http/http.go
@@ -20,6 +20,7 @@ import (
"dev.mediocregopher.com/mediocre-blog.git/src/http/apiutil"
"dev.mediocregopher.com/mediocre-blog.git/src/post"
"dev.mediocregopher.com/mediocre-blog.git/src/post/asset"
+ "dev.mediocregopher.com/mediocre-blog.git/src/render"
"dev.mediocregopher.com/mediocre-go-lib.git/mctx"
"dev.mediocregopher.com/mediocre-go-lib.git/mlog"
)
@@ -127,6 +128,7 @@ type api struct {
redirectTpl *template.Template
auther Auther
+ urlBuilder render.URLBuilder
}
// New initializes and returns a new API instance, including setting up all
@@ -147,6 +149,11 @@ func New(params Params) (API, error) {
a := &api{
params: params,
auther: NewAuther(params.AuthUsers, params.AuthRatelimit),
+ urlBuilder: render.NewURLBuilder(
+ params.PublicURL,
+ params.PublicURL, // httpURL
+ params.GeminiPublicURL,
+ ),
}
a.redirectTpl = mustParseTpl(template.New(""), "redirect.html")