mirror of
https://github.com/minio/minio.git
synced 2025-11-10 22:10:12 -05:00
Add PutBucket and ListBuckets service
This commit is contained in:
@@ -19,6 +19,7 @@ package httpserver
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Start(handler http.Handler, address string) (chan<- string, <-chan error) {
|
||||
@@ -30,7 +31,15 @@ func Start(handler http.Handler, address string) (chan<- string, <-chan error) {
|
||||
|
||||
func start(ctrlChannel <-chan string, errorChannel chan<- error, router http.Handler, address string) {
|
||||
log.Println("Starting HTTP Server on " + address)
|
||||
err := http.ListenAndServe(address, router)
|
||||
// Minio server config
|
||||
server := &http.Server{
|
||||
Addr: address,
|
||||
Handler: router,
|
||||
ReadTimeout: 10 * time.Second,
|
||||
WriteTimeout: 10 * time.Second,
|
||||
MaxHeaderBytes: 1 << 20,
|
||||
}
|
||||
err := server.ListenAndServe()
|
||||
errorChannel <- err
|
||||
close(errorChannel)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user