go-json-rest v3.0.0 Release Notes

Release Date: 2015-02-03 // about 9 years ago
  • ๐Ÿ”– Version 3 Release Notes

    What's New in v3

    • ๐Ÿ“ฆ Public Middlewares. (12 included in the package)
    • A new App interface. (the router being the provided App)
    • A new Api object that manages the Middlewares and the App.
    • Optional and interchangeable App/router.

    Here is for instance the new minimal "Hello World!"

    api := rest.NewApi() api.Use(rest.DefaultDevStack...) api.SetApp(rest.AppSimple(func(w rest.ResponseWriter, r \*rest.Request) { w.WriteJson(map[string]string{"Body": "Hello World!"}) })) http.ListenAndServe(":8080", api.MakeHandler())
    

    โšก๏ธ All 19 examples have been updated to use the new API. See here

    ๐Ÿ—„ Deprecating the ResourceHandler

    ๐Ÿ”ง V3 is about deprecating the ResourceHandler in favor of a new API that exposes the Middlewares. As a consequence, all the Middlewares are now public, and the new Api object helps putting them together as a stack. Some default stack configurations are offered. The router is now an App that sits on top of the stack of Middlewares. Which means that the router is no longer required to use Go-Json-Rest.

    ๐Ÿ‘€ Design ideas and discussion See here

    ๐Ÿ‘€ Migration guide See here