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

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.

主站蜘蛛池模板: 锦州市| 昂仁县| 嵩明县| 苏尼特右旗| 湖南省| 安徽省| 望谟县| 清丰县| 北宁市| 平乐县| 天津市| 儋州市| 那曲县| 徐汇区| 古丈县| 泾阳县| 休宁县| 镇雄县| 青田县| 西乡县| 吉水县| 乡宁县| 靖宇县| 太和县| 西乌珠穆沁旗| 花垣县| 大冶市| 芦溪县| 蒙阴县| 商水县| 鹿邑县| 青浦区| 迁安市| 惠州市| 陆河县| 新和县| 临西县| 错那县| 高唐县| 天水市| 汤阴县|