parent
111b2639cd
commit
e58cada88c
@ -1,7 +1,10 @@ |
||||
package main |
||||
|
||||
import "fmt" |
||||
import ( |
||||
"github.com/minios/minios" |
||||
) |
||||
|
||||
func main() { |
||||
fmt.Println("hello") |
||||
server := minios.Server{} |
||||
server.Start() |
||||
} |
||||
|
@ -0,0 +1,21 @@ |
||||
package minios |
||||
|
||||
import ( |
||||
"fmt" |
||||
"github.com/gorilla/mux" |
||||
"net/http" |
||||
) |
||||
|
||||
type Server struct { |
||||
} |
||||
|
||||
func (server *Server) Start() error { |
||||
r := mux.NewRouter() |
||||
r.HandleFunc("/", HelloHandler) |
||||
fmt.Println("Running http server on port 8080") |
||||
return http.ListenAndServe(":8080", r) |
||||
} |
||||
|
||||
func HelloHandler(w http.ResponseWriter, req *http.Request) { |
||||
fmt.Fprintf(w, "Host: "+req.Host) |
||||
} |
Loading…
Reference in new issue