Skip to content

Instantly share code, notes, and snippets.

@thegabriele97
Created January 14, 2020 22:26
Show Gist options
  • Save thegabriele97/520fc730cca94ed8c5696d62aa4cfc1d to your computer and use it in GitHub Desktop.
Save thegabriele97/520fc730cca94ed8c5696d62aa4cfc1d to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Logging;
using System.IO;
using Microsoft.Extensions.FileProviders;
namespace WorkerService2 {
public class Program {
public static void Main(string[] args) {
CreateHostBuilder(args)
.Build()
.Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => {
webBuilder.UseKestrel()
.UseUrls("http://127.0.0.1:80")
.ConfigureServices(services => {
services.AddSignalR();
services.AddRazorPages();
})
.Configure(app => {
app.UseRouting();
app.UseEndpoints(conf => {
conf.MapRazorPages();
});
});
})
.ConfigureServices((hostContext, services) => {
services.AddHostedService<Worker>();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment