static async Task GetSensorsAll() { string response = null; //Interface Device SingletonDevice singletonDevice = SingletonDevice.Source; for (; ;) { response = singletonDevice.GetData("GET /sensors/all"); Console.WriteLine(response); await Task.Delay(1000); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapGet("/", async context => { //Interface Device SingletonDevice singletonDevice = SingletonDevice.Source; var response = singletonDevice.GetData("GET /sensors/all"); //await context.Response.WriteAsync("Hello World!"); await context.Response.WriteAsync(response); }); }); }