News for hackers. Stuff that matters.
Re:Writing web applications using only the Go Standard Library by lobster_johnson on Friday December 23, 2016 @08:49PM (#13248192)
The first thing people tend to do is to replace the default, very primitive "mux" with a router that more closely aligns with modern expectations, such as httprouter (https://github.com/julienschmidt/httprouter) or chi (https://github.com/pressly/chi).

These libraries also support middleware wrapping [1], a technique that the default mux supports but doesn't help you with. For example, adding CORS headers or logging the request.

[1] https://justinas.org/writing-http-middleware-in-go/

There are no comments on this comment yet.