mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-15 17:00:03 +08:00
27 lines
735 B
C#
27 lines
735 B
C#
using Microsoft.AspNetCore;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using MQTTnet.AspNetCore;
|
|
using System.Threading.Tasks;
|
|
using MQTTnet.AspNetCore.Extensions;
|
|
|
|
namespace MQTTnet.TestApp.AspNetCore2
|
|
{
|
|
public static class Program
|
|
{
|
|
public static Task Main(string[] args)
|
|
{
|
|
return BuildWebHost(args).RunAsync();
|
|
}
|
|
|
|
private static IWebHost BuildWebHost(string[] args) =>
|
|
WebHost.CreateDefaultBuilder(args)
|
|
.UseKestrel(o =>
|
|
{
|
|
o.ListenAnyIP(1883, l => l.UseMqtt());
|
|
o.ListenAnyIP(5000); // default http pipeline
|
|
})
|
|
.UseStartup<Startup>()
|
|
.Build();
|
|
}
|
|
}
|