Beispiel #1
0
//Basic low level wotServer setup
func main() {
	//WoT server defines implements interaction with device
	wotServer := server.CreateFromDescriptionUri(model)
	setupWotServer(wotServer)

	//Frontend is transport implementation
	feCfg := col.AsMap([]*col.KeyValue{col.KV("port", 8080)})
	fe := frontend.NewHTTP(feCfg)
	fe.Bind("/01-basic-example", wotServer)
	fe.Start()
}
Beispiel #2
0
func (p *Platform) AddBackend(bedID, beType string, cfgParams ...*col.KeyValue) {
	params := col.AsMap(cfgParams)

	be := beTypes[beType](params)
	p.backends[bedID] = be
}