- Building RESTful Web services with Go
- Naren Yellavula
- 90字
- 2021-07-02 20:14:08
Running the code
We can run the program directly using the run command:
go run customMux.go
Now, let us fire two CURL commands and see the output:
curl -X GET http://localhost:8000/randomFloat
curl -X GET http://localhost:8000/randomInt
The responses will be:
0.6046602879796196
87
Your response may change due to the random number generator.
We saw how we can create a URL router with basic Go constructs. Now we are going to look at a few popular URL routing frameworks that are widely used by the Go community for their API servers.
推薦閱讀
- 解析QUIC/HTTP3:未來互聯網的基石
- 物聯網關鍵技術及應用
- 局域網組建、管理與維護項目教程(Windows Server 2003)
- Getting Started with WebRTC
- 新手易學:新手學淘寶開店
- 光纖通信系統與網絡(修訂版)
- 夢工廠之材質N次方:Maya材質手冊
- TD-LTE無線網絡規劃與設計
- 工業互聯網創新實踐
- 網絡利他行為研究:積極心理學的視角
- Building RESTful Web Services with .NET Core
- Guide to NoSQL with Azure Cosmos DB
- Enterprise ApplicationDevelopment with Ext JSand Spring
- RestKit for iOS
- 企業網絡組建與維護項目式教程