- Building RESTful Web services with Go
- Naren Yellavula
- 89字
- 2021-07-02 20:14:07
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.
推薦閱讀
- Cisco OSPF命令與配置手冊
- 物聯網短距離無線通信技術應用與開發
- 光網絡評估及案例分析
- 從區塊鏈到Web3:構建未來互聯網生態
- 網絡故障現場處理實踐(第4版)
- OpenLayers Cookbook
- 互聯網基礎資源技術與應用發展態勢(2021—2023)
- 互聯網安全的40個智慧洞見:2014年中國互聯網安全大會文集
- Getting Started with Grunt:The JavaScript Task Runner
- 圖解手機元器件維修技巧
- TCP/IP基礎(第2版)
- 精通SEO:100%網站流量提升密碼
- 物聯網與智慧農業
- 數字王國里的虛擬人:技術、商業與法律解讀
- Hands-On Reactive Programming in Spring 5