Skip to content

Instantly share code, notes, and snippets.

@alber999 alber999/server.go
Created Jan 27, 2016

Embed
What would you like to do?
Sample of Golang server
/*
* Golang server
*/
package main
import (
"io"
"net/http"
)
func sayHi(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello world!")
}
func main() {
http.HandleFunc("/", sayHi)
http.ListenAndServe(":8000", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.