21 lines
378 B
Go
21 lines
378 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
log "github.com/sirupsen/logrus"
|
|
"net/http"
|
|
)
|
|
|
|
func main() {
|
|
http.HandleFunc("/", helloWorldHandler)
|
|
port := 9000
|
|
|
|
log.Info("Starting on port ", port)
|
|
|
|
http.ListenAndServe(fmt.Sprint(":", port), nil)
|
|
}
|
|
|
|
func helloWorldHandler(w http.ResponseWriter, r *http.Request) {
|
|
log.Info("Request from", r.RemoteAddr)
|
|
w.Write([]byte("Hello World"))
|
|
}
|