blob: e29f13e235d85d57f1d89d207a9e11c6940c31d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
)
// setupHTTPServer defines a new http server
func setupHTTPServer() http.Server {
r := mux.NewRouter()
r.HandleFunc("/", indexHandler)
return http.Server{
Addr: fmt.Sprintf("0.0.0.0:%d", *port),
Handler: r,
}
}
// indexHandler handles the "/" endpoint
func indexHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "This is the index Handler speaking! Prepare to HACK THE PLANET!")
}
|