diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2024-05-26 21:16:02 +0200 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2024-05-26 21:16:02 +0200 |
commit | 43d8951296ce2f232ca94f0577e2e726291bf783 (patch) | |
tree | a04793b1e15e10040201dfafd1c25c649030f72c /src/http/http.go | |
parent | a6342a3748beaee1ec3c2dc662af6deec0c3959d (diff) |
Replace URL building methods with the URLBuilder
Diffstat (limited to 'src/http/http.go')
-rw-r--r-- | src/http/http.go | 7 |
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") |