
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
github.com/jeevatkm/middleware
A collection of HTTP middleware/Handler function for use with Go's net/http package. Compatible with Goji, Gorilla, Negroni & net/http (amongst many others).
go get github.com/jeevatkm/middleware
OR
go get gopkg.in/jeevatkm/middleware.v0
import "github.com/jeevatkm/middleware"
OR
import "gopkg.in/jeevatkm/middleware.v0"
Refer examples
func main() {
homeHandler := http.HandlerFunc(home)
// Adding Minify middleware
// Note: If you use any Gzip middleware, add Minify middleware after that
http.Handle("/", middleware.Minify(homeHandler))
log.Println("Starting server at localhost:8000")
http.ListenAndServe(":8000", nil)
}
func main() {
// Adding Minify middleware
// Note: If you use any Gzip middleware, add Minify middleware after that
goji.Use(middleware.Minify)
goji.Get("/", gojiHome)
goji.Serve()
}
func main() {
r := mux.NewRouter()
r.HandleFunc("/", gorillaHome)
// Adding Minify middleware
// Note: If you use any Gzip middleware, add Minify middleware after that
http.Handle("/", middleware.Minify(r))
log.Println("Starting server at localhost:8000")
http.ListenAndServe(":8000", nil)
}
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/", negroniHome)
n := negroni.Classic()
// Adding Minify middleware
n.UseHandler(middleware.Minify(mux))
n.Run(":8000")
}
Middleware released under MIT License
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.