member_gateway_rpc/server/server.go
crusader df755f58d7 ing
2018-05-08 19:14:02 +09:00

33 lines
675 B
Go

package server
import (
crpj "git.loafle.net/commons/rpc-go/protocol/json"
csgw "git.loafle.net/commons/server-go/socket/web"
"git.loafle.net/overflow/member_gateway_rpc/config"
"git.loafle.net/overflow/member_gateway_rpc/servlet"
)
func New(_config *config.Config) *csgw.Server {
rpcServerCodec := crpj.NewServerCodec()
ws := &servlet.WebappServlets{
VerifyKey: _config.VerifyKey,
SignKey: _config.SignKey,
}
ws.RPCServerCodec = rpcServerCodec
ws.UseSession = true
sh := &ServerHandlers{
ServerHandlers: *_config.ServerHandler,
Config: _config,
}
sh.RegisterServlet("/webapp", ws)
s := &csgw.Server{
ServerHandler: sh,
}
return s
}