Ejemplo n.º 1
0
func runRestFul() {
	gorest.RegisterService(new(authlib.Auth))
	gorest.RegisterService(new(authlib.TenantSvc))
	gorest.RegisterService(new(pog.POGSvc))
	gorest.RegisterService(new(applib.AppSvc))
	gorest.RegisterService(new(config.ConfigSvc))
	gorest.RegisterService(new(statservice.StatSvc))
	gorest.RegisterService(new(apisvc.ApiSvc))

	c := authlib.GetConfig()
	email.EmailAddress = c.Smtpusername
	email.Password = c.Smtppassword
	email.SMTPServer = c.Smtpserver

	if c.Https_Enabled {
		err := http.ListenAndServeTLS(":3048", c.Cirtifcate, c.PrivateKey, gorest.Handle())
		if err != nil {
			term.Write(err.Error(), term.Error)
			return
		}
	} else {
		err := http.ListenAndServe(":3048", gorest.Handle())
		if err != nil {
			term.Write(err.Error(), term.Error)
			return
		}
	}

}
Ejemplo n.º 2
0
func main() {

	gorest.RegisterService(new(authlib.Auth))
	gorest.RegisterService(new(authlib.TenantSvc))
	err := http.ListenAndServe(":6001", gorest.Handle())
	if err != nil {
		term.Write(err.Error(), term.Error)
		return
	}
	fmt.Scanln()
}
Ejemplo n.º 3
0
func (h *BulkTransferService) Start() {
	gorest.RegisterService(h)

	err := http.ListenAndServe(":3001", gorest.Handle())
	if err != nil {
		fmt.Println(err.Error())
		return
	} else {
		fmt.Println("Bulk service started in port 3001")
	}
}
Ejemplo n.º 4
0
func runRestFul() {
	gorest.RegisterService(new(lib.PayService))
	gorest.RegisterService(new(lib.BankService))
	gorest.RegisterService(new(lib.DocService))
	gorest.RegisterService(new(lib.AccountService))

	/*
		c := authlib.GetConfig()
		if c.Https_Enabled {
			err := http.ListenAndServeTLS(":4048", c.Cirtifcate, c.PrivateKey, gorest.Handle())
			if err != nil {
				term.Write(err.Error(), term.Error)
				return
			}
		} else {
	*/
	err := http.ListenAndServe(":4048", gorest.Handle())
	if err != nil {
		term.Write(err.Error(), term.Error)
		return
	}
	//	}

}