mirror of
https://github.com/minio/minio
synced 2026-08-29 14:36:37 -04:00
Adding initial web server and storage server module infrastructure
This commit is contained in:
parent
34b3cb7f9f
commit
f356599e22
4 changed files with 108 additions and 0 deletions
19
pkg/httpserver/httpserver.go
Normal file
19
pkg/httpserver/httpserver.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package httpserver
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func Start(handler http.Handler) (chan<- string, <-chan error) {
|
||||
ctrlChannel := make(chan string)
|
||||
errorChannel := make(chan error)
|
||||
go start(ctrlChannel, errorChannel, handler)
|
||||
return ctrlChannel, errorChannel
|
||||
}
|
||||
|
||||
func start(ctrlChannel <-chan string, errorChannel chan<- error, router http.Handler) {
|
||||
log.Println("Starting HTTP Server")
|
||||
err := http.ListenAndServe(":8080", router)
|
||||
errorChannel <- err
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue