You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/labs/Demo/Demo.WPF/App.xaml.cs

32 lines
932 B

using System.Threading.Tasks;
using System.Windows;
using Unosquare.Labs.EmbedIO;
using Unosquare.Labs.EmbedIO.Modules;
namespace Demo.WPF
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
public App()
{
#if DEBUG
foreach (var res in System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames())
{
System.Diagnostics.Debug.WriteLine("found resource: " + res);
}
#endif
Task.Factory.StartNew(async () =>
{
using (var server = new WebServer("http://*:5000"))
{
var assembly = typeof(Demo.App).Assembly;
server.RegisterModule(new ResourceFilesModule(assembly, "Demo.wwwroot"));
await server.RunAsync();
}
});
}
}
}