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

Running the code

Let us fire a CURL request and see what the response is for various routes:

go run customMux.go

Now, fire up a shell or browser to see the server in action. Here, I use the CURL request:

curl -X GET http://localhost:8000/

The response is:

Your random number is: 0.096970

Use Ctrl + C or Cmd + C to stop your Go server. If you are running it as a background process, use pgrep go to find the processID and kill it using kill pid.

主站蜘蛛池模板: 邹平县| 涞水县| 响水县| 诸暨市| 房产| 周口市| 那坡县| 和硕县| 综艺| 禄劝| 阿拉善右旗| 富宁县| 甘德县| 武强县| 修水县| 崇义县| 手机| 延川县| 什邡市| 绩溪县| 余江县| 绥芬河市| 龙海市| 建平县| 喀什市| 雷波县| 英吉沙县| 洛隆县| 永福县| 安泽县| 三亚市| 汪清县| 酒泉市| 十堰市| 安康市| 松江区| 冷水江市| 肇源县| 密云县| 万载县| 南溪县|