Skip to content

Instantly share code, notes, and snippets.

@dcomartin

dcomartin/startup.cs

Created Jun 17, 2020
Embed
What would you like to do?
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
You can’t perform that action at this time.