반응형 go restfulapi1 [Google Go 언어] Resultful API (Gin Web Framework) Gin Web Framework 를 이용하여 Restful API 구현 album 객체를 생성하고, 이 객체에 데이터를 추가하거나 조회하는 API 구현 package main import ( "net/http" "github.com/gin-gonic/gin" ) // 데이터 객체 type album struct { ID string `json:"id"` Title string `json:"title"` Artist string `json:"artist"` Price float64 `json:"price"` } // 데이터 var albums = []album{ {ID: "1", Title: "Blue Train", Artist: "John Coltrane", Price: 56.99}, {ID: "2", .. 2021. 11. 15. 이전 1 다음 반응형