Skip to content

Commit 7570c97

Browse files
committed
Release notes for v3
1 parent 36c753e commit 7570c97

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -1451,31 +1451,31 @@ Old v1 blog posts:
14511451

14521452
## Version 3 release notes
14531453

1454-
This new version brings:
1454+
### What's New in v3
14551455

1456-
* Public middlewares. (12 included in the package)
1456+
* Public Middlewares. (12 included in the package)
14571457
* A new App interface. (the router being the provided App)
1458-
* A new Api object that manages the middlewares and the App.
1458+
* A new Api object that manages the Middlewares and the App.
14591459
* Optional and interchangeable App/router.
14601460

1461-
Here is for instance the minimal "Hello World!":
1461+
### Here is for instance the new minimal "Hello World!"
14621462

14631463
```go
1464-
api := rest.NewApi()
1465-
api.Use(rest.DefaultDevStack...)
1466-
api.SetApp(rest.AppSimple(func(w rest.ResponseWriter, r *rest.Request) {
1467-
w.WriteJson(map[string]string{"Body": "Hello World!"})
1468-
}))
1469-
http.ListenAndServe(":8080", api.MakeHandler())
1464+
api := rest.NewApi()
1465+
api.Use(rest.DefaultDevStack...)
1466+
api.SetApp(rest.AppSimple(func(w rest.ResponseWriter, r *rest.Request) {
1467+
w.WriteJson(map[string]string{"Body": "Hello World!"})
1468+
}))
1469+
http.ListenAndServe(":8080", api.MakeHandler())
14701470
```
14711471

1472-
[All examples have been updated to use the new API.](https://github.com/ant0ine/go-json-rest#examples)
1472+
*All 19 examples have been updated to use the new API. [See here](https://github.com/ant0ine/go-json-rest#examples)*
14731473

1474+
### Deprecating the ResourceHandler
14741475

1475-
**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,
1476-
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
1477-
of the stack of middlewares. Which means that the router is no longer required to use go-json-rest.
1478-
See the design ideas and discussion [here](https://github.com/ant0ine/go-json-rest/issues/110)
1476+
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.
1477+
1478+
*Design ideas and discussion [See here](https://github.com/ant0ine/go-json-rest/issues/110)*
14791479

14801480

14811481
## Migration guide from v2 to v3

0 commit comments

Comments
 (0)