Commit 6e33a1a7 authored by Savorboard's avatar Savorboard

update sample.

parent 0a94921e
...@@ -3,6 +3,7 @@ using System.Collections.Generic; ...@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
...@@ -13,20 +14,12 @@ namespace Sample.RabbitMQ.MySql ...@@ -13,20 +14,12 @@ namespace Sample.RabbitMQ.MySql
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
var config = new ConfigurationBuilder() BuildWebHost(args).Run();
.AddCommandLine(args) }
.AddEnvironmentVariables("ASPNETCORE_")
.Build();
var host = new WebHostBuilder() public static IWebHost BuildWebHost(string[] args) =>
.UseConfiguration(config) WebHost.CreateDefaultBuilder(args)
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build();
host.Run();
}
} }
} }
...@@ -20,14 +20,6 @@ namespace Sample.RabbitMQ.MySql ...@@ -20,14 +20,6 @@ namespace Sample.RabbitMQ.MySql
x.UseEntityFramework<AppDbContext>(); x.UseEntityFramework<AppDbContext>();
x.UseRabbitMQ("localhost"); x.UseRabbitMQ("localhost");
x.UseDashboard(); x.UseDashboard();
x.UseDiscovery(d =>
{
d.DiscoveryServerHostName = "localhost";
d.DiscoveryServerPort = 8500;
d.CurrentNodeHostName = "localhost";
d.CurrentNodePort = 5800;
d.NodeName = "CAP 1号节点";
});
}); });
services.AddMvc(); services.AddMvc();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment