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

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.

主站蜘蛛池模板: 乐清市| 堆龙德庆县| 泰来县| 阜新市| 大理市| 襄垣县| 漯河市| 晴隆县| 左权县| 西平县| 延安市| 屏东县| 塘沽区| 太白县| 宕昌县| 陆丰市| 泗水县| 延长县| 墨竹工卡县| 香河县| 获嘉县| 拉孜县| 望谟县| 瑞昌市| 九江县| 山西省| 麻阳| 宜君县| 莱阳市| 卢湾区| 怀来县| 井研县| 兖州市| 青冈县| 八宿县| 手游| 香格里拉县| 三门县| 馆陶县| 饶平县| 阿克|