Created
June 17, 2020 23:24
-
-
Save dcomartin/2fb23a5a778e9987470ed14e1c2d0a31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DotNetCore.CAP; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Hosting; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace CAPDemo | |
{ | |
public class Startup | |
{ | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddTransient<HelloWorldReceiver>(); | |
services.AddCap(options => | |
{ | |
options.UseMySql("Server=localhost;Uid=root;Pwd=root;Database=Demo"); | |
options.UseRabbitMQ("localhost"); | |
options.UseDashboard(); | |
}); | |
services.AddControllersWithViews(); | |
} | |
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | |
{ | |
app.UseDeveloperExceptionPage(); | |
app.UseCapDashboard(); | |
app.UseHttpsRedirection(); | |
app.UseStaticFiles(); | |
app.UseRouting(); | |
app.UseAuthorization(); | |
app.UseEndpoints(endpoints => | |
{ | |
endpoints.MapControllerRoute( | |
name: "default", | |
pattern: "{controller=Home}/{action=Index}/{id?}"); | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment