init
This commit is contained in:
commit
ad6be315de
6 changed files with 182 additions and 0 deletions
21
main.go
Normal file
21
main.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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"))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue