mirror of
https://github.com/gusaul/grpcox.git
synced 2024-11-17 06:26:56 +00:00
27 lines
440 B
Go
27 lines
440 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"net/http"
|
|
"time"
|
|
|
|
"github.com/gorilla/mux"
|
|
"github.com/gusaul/grpcox/handler"
|
|
)
|
|
|
|
func main() {
|
|
port := ":6969"
|
|
muxRouter := mux.NewRouter()
|
|
handler.Init(muxRouter)
|
|
srv := &http.Server{
|
|
Handler: muxRouter,
|
|
Addr: "0.0.0.0" + port,
|
|
WriteTimeout: 15 * time.Second,
|
|
ReadTimeout: 15 * time.Second,
|
|
}
|
|
|
|
fmt.Println("Service started on", port)
|
|
log.Fatal(srv.ListenAndServe())
|
|
}
|