mirror of https://github.com/JustKato/FreePad.git
				
				
				
			+ FreePad version in ContentHeaders
This commit is contained in:
		
							parent
							
								
									8735837cb4
								
							
						
					
					
						commit
						5414dab201
					
				| 
						 | 
					@ -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")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue