probe_gateway_rpc/server/server.go
crusader 3fb41cf0b3 ing
2018-04-26 17:17:12 +09:00

32 lines
628 B
Go

package server
import (
cssw "git.loafle.net/commons/server-go/socket/web"
"git.loafle.net/overflow/probe_gateway_rpc/config"
"git.loafle.net/overflow/probe_gateway_rpc/servlet"
)
func New(_config *config.Config) *cssw.Server {
as := &servlet.AuthServlets{}
as.UseSession = true
ps := &servlet.ProbeServlets{}
ps.UseSession = true
ds := &servlet.DataServlets{}
sh := &ServerHandlers{
ServerHandlers: *_config.ServerHandler,
Config: _config,
}
sh.RegisterServlet("/auth", as)
sh.RegisterServlet("/probe", ps)
sh.RegisterServlet("/data", ds)
s := &cssw.Server{
ServerHandler: sh,
}
return s
}