[Go] basics and web
This commit is contained in:
20
slides/go/server.go
Normal file
20
slides/go/server.go
Normal file
@@ -0,0 +1,20 @@
|
||||
//go:build exclude
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
// web server
|
||||
|
||||
http.HandleFunc("/", a )
|
||||
http.ListenAndServe(":8080", nil)
|
||||
|
||||
}
|
||||
|
||||
func a(w http.ResponseWriter, r *http.Request){
|
||||
w.Write([]byte("Hello Web"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user