feat: include app version in sidebar footer
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m0s
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m0s
This commit is contained in:
parent
720d043dee
commit
b47e48b882
7 changed files with 46 additions and 7 deletions
16
internal/middleware/app_version.go
Normal file
16
internal/middleware/app_version.go
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
package middleware
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.juancwu.dev/juancwu/budgit/internal/ctxkeys"
|
||||
)
|
||||
|
||||
func AppVersion(version string) func(http.Handler) http.Handler {
|
||||
return func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := ctxkeys.WithAppVersion(r.Context(), version)
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue