목록고랭 (1)
Allen's 데이터 맛집
[2] Go Lang, HTTP 서버 구현 및 JSON 데이터 처리
1️⃣ 간단한 HTTP 서버 구현Go의 net/http 패키지를 사용해 HTTP 서버를 간단히 구현할 수 있습니다.package mainimport ( "fmt" "net/http")func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Welcome to GoLang Server!")}func main() { http.HandleFunc("/", handler) http.ListenAndServe(":8080", nil)}결과: 브라우저에서 http://localhost:8080로 접속 시 "Welcome to GoLang Server!" 출력.2️⃣ JSON 데이터 처리Go의 encoding/json 패..
Programming/GoLang
2025. 2. 3. 15:18