mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-07-09 02:07:47 +00:00
34 lines
861 B
C#
34 lines
861 B
C#
using ElectronNET.API;
|
|
using Microsoft.AspNetCore.Builder;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace ElectronNET.Samples.ElectronHostHook
|
|
{
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
builder.WebHost.UseElectron(args, async () =>
|
|
{
|
|
var window = await Electron.WindowManager.CreateWindowAsync();
|
|
});
|
|
|
|
builder.Services.AddElectron();
|
|
builder.Services.AddControllersWithViews();
|
|
|
|
var app = builder.Build();
|
|
|
|
app.UseStaticFiles();
|
|
app.UseRouting();
|
|
|
|
app.MapControllerRoute(
|
|
name: "default",
|
|
pattern: "{controller=Home}/{action=Index}/{id?}");
|
|
|
|
app.Run();
|
|
}
|
|
}
|
|
}
|