Created
February 16, 2025 23:09
-
-
Save nikneem/fe1cde2c92795dff13ae2ab15494b719 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Aspire.Hosting.Dapr; | |
| using System.Collections.Immutable; | |
| var builder = DistributedApplication.CreateBuilder(args); | |
| var daprComponentsFolder = new DirectoryInfo(Path.Combine( Directory.GetCurrentDirectory(), "..\\..\\dapr\\components")); | |
| if (!daprComponentsFolder.Exists) | |
| { | |
| throw new DirectoryNotFoundException($"Dapr components folder not found at {daprComponentsFolder.FullName}"); | |
| } | |
| builder.AddDapr(); | |
| var options = new DaprSidecarOptions | |
| { | |
| ResourcesPaths = ImmutableHashSet.Create(daprComponentsFolder.FullName) | |
| }; | |
| builder.AddProject<Projects.SDN_Demo_Sender_API>("sdn-demo-sender-api") | |
| .WithDaprSidecar(options); | |
| builder.AddProject<Projects.SDN_Demo_Listener_API>("sdn-demo-listener-api") | |
| .WithDaprSidecar(options); | |
| builder.Build().Run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment