net/http ile Web Server Oluşturma
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Merhaba %s", r.URL.Path[1:])
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":5555", nil)
fmt.Println("Web Sunucu")
}<!DOCTYPE html>
<html lang="tr">
<head>
<title>Sayfa Başlığı</title>
</head>
<body>
Merhaba Dünya
</body>
</html>Last updated