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

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.

主站蜘蛛池模板: 仙桃市| 开阳县| 龙川县| 邹城市| 九寨沟县| 叶城县| 高安市| 安图县| 兴隆县| 和硕县| 南部县| 遵义县| 虹口区| 安平县| 巴青县| 绩溪县| 延庆县| 新野县| 招远市| 镇宁| 滕州市| 区。| 濮阳市| 滦南县| 陆川县| 徐水县| 合江县| 从江县| 浦东新区| 合水县| 忻州市| 新宁县| 安西县| 乐亭县| 营口市| 涡阳县| 全南县| 潮州市| 图们市| 南京市| 黎川县|