/// <summary> /// Creates a webmodule listening to the get requests for all the sensors. /// </summary> /// <param name="serializer"></param> /// <param name="sensorFactory"></param> public WebModule(Serializer.ISerializer serializer, ISensorFactory sensorFactory) { _serializer = serializer; foreach (var sensor in sensorFactory.GetSensors()) { string getPath = $"/{sensor.Name}"; Console.WriteLine($"Listening for get on {getPath}"); Get[getPath] = paramaters => QuerySensor(sensor); } }