Router in Gin
Given a URL /api/users/1234/pages
, how an HTTP server finds the corresponding handler for it? Router helps to convert the concrete URL to a pattern and its handler.
This blog introduces the routers in Gin framework. In short, Gin uses trie(prefix tree) to maintain the URL-handler mapping.