The middleware has been archived, please use the middleware of elton.
HTTP response freshness testing middleware for elton.
package main
import (
"bytes"
"github.com/vicanso/elton"
etag "github.com/vicanso/elton-etag"
fresh "github.com/vicanso/elton-fresh"
)
func main() {
e := elton.New()
e.Use(fresh.NewDefault())
e.Use(etag.NewDefault())
e.GET("/", func(c *elton.Context) (err error) {
c.BodyBuffer = bytes.NewBufferString("abcd")
return
})
err := e.ListenAndServe(":3000")
if err != nil {
panic(err)
}
}