import "github.com/gin-gonic/gin"
func getting(c *gin.Context) {
func posting(c *gin.Context) {
func putting(c *gin.Context) {
func deleting(c *gin.Context) {
func patching(c *gin.Context) {
func head(c *gin.Context) {
func options(c *gin.Context) {
// gin.DisableConsoleColor()
// 建立一個帶有預設中介軟體的 gin 路由器:
// logger 和 recovery (無崩潰) 中介軟體
router.GET("/someGet", getting)
router.POST("/somePost", posting)
router.PUT("/somePut", putting)
router.DELETE("/someDelete", deleting)
router.PATCH("/somePatch", patching)
router.HEAD("/someHead", head)
router.OPTIONS("/someOptions", options)
// 預設情況下,它會在 :8080 上提供服務,除非定義了
// router.Run(":3000") 可用於硬性編碼的連接埠