Kaynağa Gözat

first simple http server is up and running

master
sp 4 yıl önce
ebeveyn
işleme
43207aaada
1 değiştirilmiş dosya ile 18 ekleme ve 0 silme
  1. +18
    -0
      main.go

+ 18
- 0
main.go Dosyayı Görüntüle

@@ -0,0 +1,18 @@
package main

import (
"fmt"
"log"
"net/http"
)

func main() {

http.HandleFunc("/", HelloHandler)
fmt.Println("Server started at port 8080")
log.Fatal(http.ListenAndServe(":8080", nil))
}

func HelloHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, there\n")
}

Yükleniyor…
İptal
Kaydet