+ FreePad version in ContentHeaders

This commit is contained in:
Daniel Legt 2022-05-22 20:15:11 +03:00
parent 8735837cb4
commit 5414dab201
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,15 @@
package controllers
import "github.com/gin-gonic/gin"
func ApplyHeaders(router *gin.Engine) {
router.Use(func(ctx *gin.Context) {
// Apply the header
ctx.Header("FreePad-Version", "1.1.0")
// Move on
ctx.Next()
})
}

View File

@ -25,6 +25,9 @@ func main() {
// Initialize the router // Initialize the router
router := gin.Default() router := gin.Default()
// Apply the FreePad Headers
controllers.ApplyHeaders(router)
// Read HTML Templates // Read HTML Templates
router.LoadHTMLGlob("templates/**/*.html") router.LoadHTMLGlob("templates/**/*.html")