mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
miniosd is now an http server, responds with hello world at root.
This commit is contained in:
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()
|
||||
}
|
||||
|
21
server.go
Normal file
21
server.go
Normal file
@ -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
Block a user