forked from urdt/ussd
set the africastalking POST route using env
This commit is contained in:
parent
256ed6491b
commit
574807d254
@ -16,3 +16,6 @@ CREATE_ACCOUNT_URL=http://localhost:5003/api/v2/account/create
|
||||
TRACK_STATUS_URL=https://custodial.sarafu.africa/api/track/
|
||||
BALANCE_URL=https://custodial.sarafu.africa/api/account/status/
|
||||
TRACK_URL=http://localhost:5003/api/v2/account/status
|
||||
|
||||
#AfricasTalking USSD POST endpoint
|
||||
AT_ENDPOINT=/ussd/africastalking
|
||||
|
@ -197,9 +197,13 @@ func main() {
|
||||
rp := &atRequestParser{}
|
||||
bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)
|
||||
sh := httpserver.NewATSessionHandler(bsh)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle(initializers.GetEnv("AT_ENDPOINT", "/"), sh)
|
||||
|
||||
s := &http.Server{
|
||||
Addr: fmt.Sprintf("%s:%s", host, strconv.Itoa(int(port))),
|
||||
Handler: sh,
|
||||
Handler: mux,
|
||||
}
|
||||
s.RegisterOnShutdown(sh.Shutdown)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user