mirror of
https://github.com/JustKato/FreePad.git
synced 2026-04-03 18:38:47 +03:00
+ FreePad version in ContentHeaders
This commit is contained in:
15
lib/controllers/controllers_header.go
Normal file
15
lib/controllers/controllers_header.go
Normal 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()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
3
main.go
3
main.go
@@ -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")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user