官术网_书友最值得收藏!

Introducing gorilla/mux – a powerful HTTP router

The word Mux stands for the multiplexer. gorilla/mux is a multiplexer designed to multiplex HTTP routes (URLs) to different handlers. Handlers are the functions that can handle the given requests. gorilla/mux is a wonderful package for writing beautiful routes for our API servers.

gorilla/mux provides tons of options to control how routing is done to your web application. It allows a lot of features, such as:

  • Path-based matching
  • Query-based matching
  • Domain-based matching
  • Sub-domain-based matching
  • Reverse URL generation

Which type of routing to use depends on the types of clients requesting the server. We first see the installation and then a basic example to understand the gorilla/mux package.

主站蜘蛛池模板: 武乡县| 双流县| 错那县| 营山县| 金昌市| 沧州市| 财经| 隆化县| 聊城市| 汤原县| 武川县| 百色市| 昌宁县| 东阿县| 伊春市| 历史| 天峻县| 神农架林区| 永胜县| 德清县| 交口县| 麻城市| 抚顺县| 衡东县| 麟游县| 义乌市| 永济市| 永平县| 淮南市| 沈丘县| 隆子县| 新竹市| 方城县| 和田市| 吉林市| 昭平县| 陆河县| 宁强县| 阿瓦提县| 嘉荫县| 延吉市|