File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33using EcoFlow . Mqtt . Api . Extensions ;
44using EcoFlow . Mqtt . Api . Services ;
55using Microsoft . AspNetCore . Builder ;
6- using Microsoft . AspNetCore . Hosting ;
76using Microsoft . Extensions . DependencyInjection ;
87using Microsoft . Extensions . Logging ;
98using Microsoft . Extensions . Options ;
1211
1312builder . Logging . AddFilter ( nameof ( Microsoft ) , LogLevel . Warning ) ;
1413builder . Logging . AddFilter ( nameof ( System ) , LogLevel . Warning ) ;
14+ builder . Logging . AddFilter ( "Microsoft.AspNetCore.Hosting.Diagnostics" , LogLevel . Error ) ;
1515
1616builder . Services . AddHttpClient ( ) ;
1717builder . Services . ConfigureAnonymousHttpClient ( ) ;
2121builder . Services . AddSingleton < InternalMqttApi > ( ) ;
2222builder . Services . AddHostedService ( serviceProvider => serviceProvider . GetRequiredService < InternalMqttApi > ( ) ) ;
2323
24- builder . WebHost . UseUrls ( $ "http://*:{ ( Environment . GetEnvironmentVariable ( "HTTP_PORT" ) is { } httpPortValue && int . TryParse ( httpPortValue , out var httpPort ) ? httpPort : 80 ) } ") ;
25-
2624var app = builder . Build ( ) ;
2725
2826var configuration = app . Services . GetRequiredService < IOptions < EcoFlowConfiguration > > ( ) ;
You can’t perform that action at this time.
0 commit comments