Skip to content
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.

Latest commit

 

History

History
59 lines (43 loc) · 1.21 KB

File metadata and controls

59 lines (43 loc) · 1.21 KB

| EN

Masa.Utils.Development.Dapr.AspNetCore

Responsibilities:

Assist in managing the dapr process to reduce the dependency on docker compose during development

Basic usage:

  1. Install Masa.Utils.Development.Dapr.AspNetCore
Install-Package Masa.Utils.Development.Dapr.AspNetCore
  1. Add DaprStarter to assist in managing the dapr process (recommended to be used in the development environment)
builder.Services.AddDaprStarter();

Advanced usage:

  1. Specify the configuration in the code
builder.Services.AddDaprStarter(opt =>
{
    opt.AppId = "masa-dapr-test";
    opt.AppPort = 5001;
    opt.AppIdSuffix = "";
    opt.DaprHttpPort = 8080;
    opt.DaprGrpcPort = 8081;
});
  1. The configuration file specifies the configuration

First step:

{
  "DaprOptions": {
    "AppId": "masa-dapr-test",
    "AppPort": 5001,
    "AppIdSuffix": "",
    "DaprHttpPort": 8080,
    "DaprGrpcPort": 8081
  }
}

Step 2:

builder.Services.AddDaprStarter(builder.Configuration.GetSection("DaprOptions");

Advantages: After the configuration is changed, the dapr process is restarted and updated, and the project does not need to be restarted