Richard Bucker

labstack echo - nice http server in go

Posted at — Oct 8, 2015

The echo http server is pretty nice even though it’s missing a feature or two.I would like to be able to serve assets directly from go-bindata’s assetfssetting a root path without it being a path substitutionmissing ServeContent()func main() {        flag.Parse()        // Echo instance        e := echo.New()        // Middleware        e.Use(mw.Logger())        e.Use(mw.Recover())        e.Static("/public”, “www/public”)        // Routes        e.Index(“public/index.html”)        e.ServeFile("/welcome”, “welcome.html”)        e.ServeFile("/styles.css”, “styles.css”)        e.Get("/a”, hello)        // Start server        log.Printf(“Listening to port: %v”, *bindto)        e.Run(*bindto)}Some good stufffastzero stackwebsocketsJWT (even though I do not trust it)graceful shutdown