mirror of
https://github.com/gusaul/grpcox.git
synced 2024-11-17 06:26:56 +00:00
27 lines
442 B
Go
27 lines
442 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: "127.0.0.1" + port,
|
||
|
WriteTimeout: 15 * time.Second,
|
||
|
ReadTimeout: 15 * time.Second,
|
||
|
}
|
||
|
|
||
|
fmt.Println("Service started on", port)
|
||
|
log.Fatal(srv.ListenAndServe())
|
||
|
}
|