Skip to content

Commit

Permalink
updated endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
adranwit committed Oct 20, 2020
1 parent 85253f4 commit a4561a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions endpoint/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package endpoint
import (
"context"
"fmt"
"github.com/viant/datly/shared"
"log"
"net/http"
"os"
Expand Down Expand Up @@ -42,10 +43,10 @@ func (r *Server) shutdownOnInterrupt() {
}

//New creates a new server
func New(port int, handlers map[string]http.Handler) *Server {
func New(port int, handlers map[string]shared.Handle) *Server {
mux := http.NewServeMux()
for k, v := range handlers {
mux.Handle(k, v)
mux.HandleFunc(k, v)
}
result := &Server{port: port}
result.Server.Addr = ":" + fmt.Sprintf("%d", port)
Expand Down

0 comments on commit a4561a9

Please sign in to comment.