Skip to content

Releases: gebes/there

Header

Choose a tag to compare

@gebes gebes released this 28 Jul 14:46

Now supporting CanonicalMIMEHeaderKey

Full Changelog: v2.2.9...v2.3.0

Module name

Choose a tag to compare

@gebes gebes released this 16 Jun 15:03

Sanitized module name

Apply default content type

Choose a tag to compare

@gebes gebes released this 04 May 07:14

When no content type is specified, handlers like Json, Xml or String will automatically apply a content type

Default handler and middleware fix

Choose a tag to compare

@gebes gebes released this 03 May 21:12

Full Changelog: v2.2.2...v2.2.3

Mux rework

Choose a tag to compare

@gebes gebes released this 03 May 19:47

Full Changelog: v2.2.0...v2.2.1

Mux rework

Choose a tag to compare

@gebes gebes released this 03 May 18:40
48bc613

Moved headers and statuses to the status and header package
Speed improvement with the built in go mux

What's Changed

New Contributors

Full Changelog: v2.1.3...v2.2.0

Quality of life improvements

Choose a tag to compare

@gebes gebes released this 16 Apr 18:40

Changes to the router configuration

Route not found handler

Override the RouteNotFoundHandler to change default behavior.

//RouterConfiguration is a straightforward place to override default behavior of the router
type RouterConfiguration struct {
	//RouteNotFoundHandler gets invoked, when the specified URL and method have no handlers
	RouteNotFoundHandler Endpoint
}

http.Server

On the router you now got direct access to the http.Server

err := router.Server.Shutdown(context.Background())

Redirect status code

Choose a tag to compare

@gebes gebes released this 31 Dec 11:34

Minor change to the Redirect response

There now provides the option to set the status code for a Redirect response.

func Redirect(code int, url string) HttpResponse {
router.Get("/redirect", func(request HttpRequest) HttpResponse {
	return Redirect(StatusMovedPermanently, "https://google.com")
})

WithHeader bug fix

Choose a tag to compare

@gebes gebes released this 16 Dec 09:30
19efd95

Changes

  • The WithHeader wrapper now only sets header if they haven't been set before.
  • This gives the option to override headers from other responses.

Example

We override the Json response Content-Type header from application/json to application/json; charset=utf-8. Because we set the header to application/json; charset=utf-8 the Header from the Json Response won't be set.

return WithHeaders(MapString{
	"Content-Type": "application/json; charset=utf-8",
}, Json(StatusOK, data))

🥳 Middlewares & Responses Rework and new docs

Choose a tag to compare

@gebes gebes released this 11 Dec 23:13

Gopher There
This release adds many (breaking) changes.

Documentation

To get a clear overview, visit the all-new docs.

Middlewares

Middlewares have been reworked from the ground up to provide the full functionality you would expect from a router. Now you can use all the Middlewares you have ever created in your life, with little to no changes in There!

Previous middlewares still work as they were intended. Only several small things need to be changed

  • Context is now parsed with the request.WithContext(ctx) method
  • Instead of Next() you now return the parsed next parameter

Find more info about the changes in the docs.

HttpResponse

The interface has been reworked, and it is now way easier to implement your own HttpResponses. Also, Msgpack and Yaml have been removed to eliminate all third-party dependencies to make There even more lightweight.

You can find a list of all reworked HttpResponses in the docs.

Most important change

There now has a great new mascot! How do you like it?

Help

If you need help, join our discord or create an issue.