AnyoneDeveloper.Grpc.UI
1.0.0
dotnet add package AnyoneDeveloper.Grpc.UI --version 1.0.0
NuGet\Install-Package AnyoneDeveloper.Grpc.UI -Version 1.0.0
<PackageReference Include="AnyoneDeveloper.Grpc.UI" Version="1.0.0" />
paket add AnyoneDeveloper.Grpc.UI --version 1.0.0
#r "nuget: AnyoneDeveloper.Grpc.UI, 1.0.0"
// Install AnyoneDeveloper.Grpc.UI as a Cake Addin #addin nuget:?package=AnyoneDeveloper.Grpc.UI&version=1.0.0 // Install AnyoneDeveloper.Grpc.UI as a Cake Tool #tool nuget:?package=AnyoneDeveloper.Grpc.UI&version=1.0.0
anyone-dotnet-use-grpc-ui
This repo simply help you to hosting a grpcUI portal from referenced application. This repo depends on gRpc reflection and this project: https://github.com/fullstorydev/grpcui
I created library for .NET 5 web application. I use Process class to run released executable program. And output the information to the logger. You can add GrpcUI_Url as Environment Variable.
This repo would bundle nuget package. Anyone can reference it from nuget.org. The nuget package only provide a simple way to hosting gRpc UI whenever application runs up. When you debug gRpc application, No need to type in commands every time.
If you like my module, please buy me a coffee.
More and more tiny and useful GitHub action modules are on the way. Please donate to me. I accept a part-time job contract. if you need, please contact me: zhang_nan_163@163.com
Be Attention
I tested it in windows 10 x86_64 environment. There is no guarantee that it would run properly in linux or macOS. Official executable program only support x86, x64 architecture. It cannot run in Arm platform, including Apple M1 chip platform.
How to use
Set up gRPC reflection
- Add a Grpc.AspNetCore.Server.Reflection package reference.
- Register reflection in Startup.cs
- AddGrpcReflection to register services that enable reflection.
- MapGrpcReflectionService to add a reflection service endpoint.
public void ConfigureServices(IServiceCollection services)
{
services.AddGrpc();
services.AddGrpcReflection(); //add code
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGrpcService<GreeterService>();
/*add below code*/
if (env.IsDevelopment())
{
endpoints.MapGrpcReflectionService();
}
});
}
Add Environment Variable
Library rely on GrpcUI_Url variable. Please set applicationUrl as value from launchSettings.json.
<img src="https://raw.githubusercontent.com/anyone-developer/anyone-dotnet-use-grpc-ui/main/misc/screenshot1.png" width="500">
Reference nupkg and use it
reference nupkg from nuget server. just simply adding:
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseGrpcUI(factory); //add
}
Every time you debug your application. the grpcui would run in background and prompt up portal page. just like Swagger UI did.
<img src="https://raw.githubusercontent.com/anyone-developer/anyone-dotnet-use-grpc-ui/main/misc/screenshot2.png" width="500"> <img src="https://raw.githubusercontent.com/anyone-developer/anyone-dotnet-use-grpc-ui/main/misc/screenshot3.png" width="500">
Donation
PalPal: https://paypal.me/nzhang4
<img src="https://raw.githubusercontent.com/anyone-developer/anyone-dotnet-use-grpc-ui/main/misc/alipay.JPG" width="500">
<img src="https://raw.githubusercontent.com/anyone-developer/anyone-dotnet-use-grpc-ui/main/misc/webchat_pay.JPG" width="500">
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 902 | 4/7/2021 |