Procházet zdrojové kódy

first simple http server is up and running

master
sp před 4 roky
rodič
revize
43207aaada
1 změnil soubory, kde provedl 18 přidání a 0 odebrání
  1. +18
    -0
      main.go

+ 18
- 0
main.go Zobrazit soubor

@@ -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")
}

Načítá se…
Zrušit
Uložit