Permalink
Browse files

Add MagicOnion.HttpGateway

  • Loading branch information...
1 parent 3a1419f commit 9b0993bc0b0dadeb0b4e1f84eb1309ce4ca0cd0d @neuecc committed Dec 18, 2016
Showing with 28,224 additions and 71 deletions.
  1. +8 −0 MagicOnion.sln
  2. +67 −1 README.md
  3. +30 −0 nuget/MagicOnion.HttpGateway.nuspec
  4. +3 −3 nuget/MagicOnion.nuspec
  5. +2 −1 nuget/pack.bat
  6. +2 −1 nuget/push.bat
  7. +4 −4 sandbox/Sandbox.ConsoleClient/Sandbox.ConsoleClient.csproj
  8. +2 −2 sandbox/Sandbox.ConsoleClient/packages.config
  9. +17 −1 sandbox/Sandbox.ConsoleServer/App.config
  10. +38 −1 sandbox/Sandbox.ConsoleServer/Program.cs
  11. +201 −5 sandbox/Sandbox.ConsoleServer/Sandbox.ConsoleServer.csproj
  12. +15 −0 sandbox/Sandbox.ConsoleServer/Services/ArgumentPattern.cs
  13. +80 −2 sandbox/Sandbox.ConsoleServer/packages.config
  14. +5 −0 sandbox/Sandbox.ConsoleServerDefinition/IArgumentPattern.cs
  15. +9 −0 sandbox/Sandbox.ConsoleServerDefinition/IMyFirstService.cs
  16. +2 −0 sandbox/Sandbox.ConsoleServerDefinition/Sandbox.ConsoleServerDefinition.csproj
  17. BIN src/MagicOnion.Client.Unity/Assets/Plugins/SharedLibrary.dll
  18. +2 −2 src/MagicOnion.CodeGenerator/Properties/AssemblyInfo.cs
  19. +250 −0 src/MagicOnion.HttpGateway/MagicOnion.HttpGateway.csproj
  20. +168 −0 src/MagicOnion.HttpGateway/MagicOnionHttpGatewayMiddleware.cs
  21. +26 −0 src/MagicOnion.HttpGateway/MagicOnionMiddlewareExtensions.cs
  22. +135 −0 src/MagicOnion.HttpGateway/MagicOnionSwaggerMiddleware.cs
  23. +36 −0 src/MagicOnion.HttpGateway/Properties/AssemblyInfo.cs
  24. +319 −0 src/MagicOnion.HttpGateway/Swagger/Schema/SwaggerDocument.cs
  25. +445 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerDefinitionBuilder.cs
  26. +26 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerOptions.cs
  27. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/css/print.css
  28. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/css/reset.css
  29. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/css/screen.css
  30. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/css/style.css
  31. 0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/css/typography.css
  32. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/fonts/DroidSans-Bold.ttf
  33. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/fonts/DroidSans.ttf
  34. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/collapse.gif
  35. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/expand.gif
  36. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/explorer_icons.png
  37. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/favicon-16x16.png
  38. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/favicon-32x32.png
  39. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/favicon.ico
  40. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/logo_small.png
  41. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/pet_store_api.png
  42. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/throbber.gif
  43. BIN src/MagicOnion.HttpGateway/Swagger/SwaggerUI/images/wordnik_api.png
  44. +107 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/index.html
  45. +53 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/ca.js
  46. +56 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/el.js
  47. +56 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/en.js
  48. +53 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/es.js
  49. +54 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/fr.js
  50. +56 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/geo.js
  51. +52 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/it.js
  52. +56 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/ja.js
  53. +53 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/ko-kr.js
  54. +53 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/pl.js
  55. +53 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/pt.js
  56. +56 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/ru.js
  57. +53 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/tr.js
  58. +39 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/translator.js
  59. +56 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lang/zh-cn.js
  60. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/backbone-min.js
  61. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/es5-shim.js
  62. +28 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/handlebars-2.0.0.js
  63. +3 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/handlebars-4.0.5.js
  64. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/highlight.9.1.0.pack.js
  65. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/highlight.9.1.0.pack_extended.js
  66. +3 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/jquery-1.8.0.min.js
  67. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/jquery.ba-bbq.min.js
  68. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/jquery.slideto.min.js
  69. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/jquery.wiggle.min.js
  70. +2 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/js-yaml.min.js
  71. +5 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/jsoneditor.min.js
  72. +2 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/lodash.min.js
  73. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/marked.js
  74. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/object-assign-pollyfill.js
  75. +4 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/sanitize-html.min.js
  76. +1 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/lib/swagger-oauth.js
  77. +20 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/o2c.html
  78. +25,126 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/swagger-ui.js
  79. +14 −0 src/MagicOnion.HttpGateway/Swagger/SwaggerUI/swagger-ui.min.js
  80. +13 −0 src/MagicOnion.HttpGateway/Utils.cs
  81. +11 −0 src/MagicOnion.HttpGateway/app.config
  82. +60 −0 src/MagicOnion.HttpGateway/packages.config
  83. +5 −4 src/MagicOnion/MagicOnion.csproj
  84. +7 −0 src/MagicOnion/MagicOnionMarshallers.cs
  85. +2 −2 src/MagicOnion/Properties/AssemblyInfo.cs
  86. +9 −5 src/MagicOnion/Server/MagicOnionEngine.cs
  87. +22 −0 src/MagicOnion/Server/MagicOnionServiceDefinition.cs
  88. +58 −27 src/MagicOnion/Server/MethodHandler.cs
  89. +2 −2 src/MagicOnion/packages.config
  90. +7 −0 tests/MagicOnion.Tests/App.config
  91. +5 −4 tests/MagicOnion.Tests/MagicOnion.Tests.csproj
  92. +2 −2 tests/MagicOnion.Tests/_ServerFixture.cs
  93. +2 −2 tests/MagicOnion.Tests/packages.config
View
@@ -23,13 +23,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sandbox.ConsoleServerDefini
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget", "nuget", "{7F61607D-5772-4E41-9D37-04E6AE7E47BA}"
ProjectSection(SolutionItems) = preProject
+ nuget\MagicOnion.HttpGateway.nuspec = nuget\MagicOnion.HttpGateway.nuspec
nuget\MagicOnion.nuspec = nuget\MagicOnion.nuspec
nuget\pack.bat = nuget\pack.bat
nuget\push.bat = nuget\push.bat
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicOnion.CodeGenerator", "src\MagicOnion.CodeGenerator\MagicOnion.CodeGenerator.csproj", "{9633B452-A984-46A6-9A92-B6291561BA09}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicOnion.HttpGateway", "src\MagicOnion.HttpGateway\MagicOnion.HttpGateway.csproj", "{FCE03661-803E-4629-944F-45DB6B444320}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -64,6 +67,10 @@ Global
{9633B452-A984-46A6-9A92-B6291561BA09}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9633B452-A984-46A6-9A92-B6291561BA09}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9633B452-A984-46A6-9A92-B6291561BA09}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FCE03661-803E-4629-944F-45DB6B444320}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FCE03661-803E-4629-944F-45DB6B444320}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FCE03661-803E-4629-944F-45DB6B444320}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FCE03661-803E-4629-944F-45DB6B444320}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -76,5 +83,6 @@ Global
{6BDE33A5-2744-40E5-8999-BF0465745587} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
{26D5411C-460A-489A-A1E8-B7CC0B4D05BB} = {7682EFFC-681C-4DCC-B5E7-D8449E42DAC9}
{9633B452-A984-46A6-9A92-B6291561BA09} = {1987061F-8970-4018-8D58-6932961C9EB4}
+ {FCE03661-803E-4629-944F-45DB6B444320} = {1987061F-8970-4018-8D58-6932961C9EB4}
EndGlobalSection
EndGlobal
View
@@ -6,7 +6,7 @@ Work in progress, stay tuned.
Quick Start
---
-alpha-version is available in NuGet(Currently only work on .NET 4.5, .NET Core is not yet, Unity supports see [Unity Supports](https://github.com/neuecc/MagicOnion#unity-supports) section)
+alpha-version is available in NuGet(Currently only work on .NET 4.5, .NET Core is not yet, Unity supports see [Unity Supports](https://github.com/neuecc/MagicOnion#unity-supports) section, HttpGateway + Swagger Intergarion supports see [Swagger](https://github.com/neuecc/MagicOnion#swagger) section)
* Install-Package MagicOnion -Pre
@@ -255,6 +255,72 @@ static async Task DuplexStreamRun(IMyFirstService client)
}
```
+Swagger
+---
+MagicOnion has built-in Http1 JSON Gateway and [Swagger](http://swagger.io/) integration for Unary operation.
+
+* Install-Package MagicOnion.HttpGateway -Pre
+
+HttpGateway is built on ASP.NET Core. for example, with `Microsoft.AspNetCore.Server.WebListener`.
+
+```csharp
+static void Main(string[] args)
+{
+ // gRPC definition.
+ GrpcEnvironment.SetLogger(new ConsoleLogger());
+ var service = MagicOnionEngine.BuildServerServiceDefinition(new MagicOnionOptions(true)
+ {
+ MagicOnionLogger = new MagicOnionLogToGrpcLogger()
+ });
+ var server = new global::Grpc.Core.Server
+ {
+ Services = { service },
+ Ports = { new ServerPort("localhost", 12345, ServerCredentials.Insecure) }
+ };
+ server.Start();
+
+ // ASP.NET Core definition.
+ var webHost = new WebHostBuilder()
+ .ConfigureServices(collection =>
+ {
+ // Add MagicOnionServiceDefinition for reference from Startup.
+ collection.Add(new ServiceDescriptor(typeof(MagicOnionServiceDefinition), service));
+ })
+ .UseWebListener()
+ .UseStartup<Startup>()
+ .UseUrls("http://localhost:5432")
+ .Build();
+
+ webHost.Run();
+}
+```
+
+```csharp
+public class Startup
+{
+ public void Configure(IApplicationBuilder app)
+ {
+ // Take from builder.
+ var magicOnion = app.ApplicationServices.GetService<MagicOnionServiceDefinition>();
+
+ // Optional:Summary to Swagger
+ var xmlName = "Sandbox.ConsoleServerDefinition.xml";
+ var xmlPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), xmlName);
+
+ // HttpGateway has two middlewares.
+ // One is SwaggerView(MagicOnionSwaggerMiddleware)
+ // One is Http1-JSON to gRPC-MagicOnion gateway(MagicOnionHttpGateway)
+ app.UseMagicOnionSwagger(magicOnion.MethodHandlers, new SwaggerOptions("MagicOnion.Server", "Swagger Integration Test", "/")
+ {
+ XmlDocumentPath = xmlPath
+ });
+ app.UseMagicOnionHttpGateway(magicOnion.MethodHandlers, new Channel("localhost:12345", ChannelCredentials.Insecure));
+ }
+}
+```
+
+![image](https://cloud.githubusercontent.com/assets/46207/21295543/aa1171a8-c59a-11e6-93f8-e3f805fe246b.png)
+
Unity Supports
---
Code is located in `src/MagicOnion.Client.Unity/Assets/Scripts/gRPC` (port of Grpc.Core) and `src/MagicOnion.Client.Unity/Assets/Scripts/MagicOnion` (MagicOnion Runtime). There are require [ZeroFormatter](https://github.com/neuecc/ZeroFormatter) and [UniRx](https://github.com/neuecc/UniRx).
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
+ <metadata>
+ <id>MagicOnion.HttpGateway</id>
+ <version>0.3.0-alpha</version>
+ <title>MagicOnion</title>
+ <authors>neuecc</authors>
+ <owners>y.neuecc</owners>
+ <projectUrl>https://github.com/neuecc/MagicOnion</projectUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <description>HTTP1 JSON Gateway and Swagger Integration for MagicOnion.</description>
+ <releaseNotes>alpha release.</releaseNotes>
+ <tags>gRPC, HTTP2</tags>
+ <frameworkAssemblies>
+ <frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.5" />
+ <frameworkAssembly assemblyName="System.Core" targetFramework=".NETFramework4.5" />
+ </frameworkAssemblies>
+ <dependencies>
+ <group targetFramework=".NETFramework4.5">
+ <dependency id="MagicOnion" version="0.3.0-alpha" />
+ <dependency id="Microsoft.AspNetCore.Http.Abstractions" version="1.1.0" />
+ <dependency id="Newtonsoft.Json" version="9.0.1" />
+ </group>
+ </dependencies>
+ </metadata>
+ <files>
+ <file src="..\src\MagicOnion.HttpGateway\bin\Release\MagicOnion.HttpGateway.dll" target="lib\net45" />
+ <file src="..\src\MagicOnion.HttpGateway\bin\Release\MagicOnion.HttpGateway.xml" target="lib\net45" />
+ </files>
+</package>
@@ -2,14 +2,14 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MagicOnion</id>
- <version>0.2.0-alpha</version>
+ <version>0.3.0-alpha</version>
<title>MagicOnion</title>
<authors>neuecc</authors>
<owners>y.neuecc</owners>
<projectUrl>https://github.com/neuecc/MagicOnion</projectUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>gRPC based HTTP2 RPC Streaming Framework for .NET, .NET Core and Unity.</description>
- <releaseNotes>Initial alpha release.</releaseNotes>
+ <releaseNotes>alpha release.</releaseNotes>
<tags>gRPC, HTTP2</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.5" />
@@ -18,7 +18,7 @@
<dependencies>
<group targetFramework=".NETFramework4.5">
<dependency id="Grpc" version="1.0.1" />
- <dependency id="ZeroFormatter" version="1.5.5" />
+ <dependency id="ZeroFormatter" version="1.5.6" />
</group>
</dependencies>
</metadata>
View
@@ -1 +1,2 @@
-nuget pack MagicOnion.nuspec
+nuget pack MagicOnion.nuspec
+nuget pack MagicOnion.HttpGateway.nuspec
View
@@ -1 +1,2 @@
-nuget push MagicOnion.0.2.0-alpha.nupkg -Source https://www.nuget.org/api/v2/package
+nuget push MagicOnion.0.3.0-alpha.nupkg -Source https://www.nuget.org/api/v2/package
+nuget push MagicOnion.HttpGateway.0.3.0-alpha.nupkg -Source https://www.nuget.org/api/v2/package
@@ -51,12 +51,12 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
- <Reference Include="ZeroFormatter, Version=1.5.5.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\..\packages\ZeroFormatter.1.5.5\lib\net45\ZeroFormatter.dll</HintPath>
+ <Reference Include="ZeroFormatter, Version=1.5.6.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\ZeroFormatter.1.5.6\lib\net45\ZeroFormatter.dll</HintPath>
<Private>True</Private>
</Reference>
- <Reference Include="ZeroFormatter.Interfaces, Version=1.5.5.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\..\packages\ZeroFormatter.Interfaces.1.5.5\lib\net45\ZeroFormatter.Interfaces.dll</HintPath>
+ <Reference Include="ZeroFormatter.Interfaces, Version=1.5.6.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\..\packages\ZeroFormatter.Interfaces.1.5.6\lib\net45\ZeroFormatter.Interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
@@ -3,6 +3,6 @@
<package id="Grpc" version="1.0.1" targetFramework="net461" />
<package id="Grpc.Core" version="1.0.1" targetFramework="net461" />
<package id="System.Interactive.Async" version="3.0.0" targetFramework="net461" />
- <package id="ZeroFormatter" version="1.5.5" targetFramework="net461" />
- <package id="ZeroFormatter.Interfaces" version="1.5.5" targetFramework="net461" />
+ <package id="ZeroFormatter" version="1.5.6" targetFramework="net461" />
+ <package id="ZeroFormatter.Interfaces" version="1.5.6" targetFramework="net461" />
</packages>
@@ -1,6 +1,22 @@
-<?xml version="1.0" encoding="utf-8" ?>
+<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.2.1.0" newVersion="1.2.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
</configuration>
@@ -1,7 +1,15 @@
using Grpc.Core;
using Grpc.Core.Logging;
+using Microsoft.AspNetCore.Hosting;
using MagicOnion.Server;
using System;
+using Microsoft.AspNetCore.Builder;
+using System.Text;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.DependencyInjection;
+using System.IO;
+using System.Reflection;
+using MagicOnion.HttpGateway.Swagger;
namespace MagicOnion.ConsoleServer
{
@@ -28,7 +36,36 @@ static void Main(string[] args)
server.Start();
- Console.ReadLine();
+
+ var webHost = new WebHostBuilder()
+ .ConfigureServices(collection =>
+ {
+ collection.Add(new ServiceDescriptor(typeof(MagicOnionServiceDefinition), service));
+ })
+ .UseWebListener()
+ .UseStartup<Startup>()
+ .UseUrls("http://localhost:5432")
+ .Build();
+
+ webHost.Run();
+ }
+ }
+
+ // AspNet Startup
+ public class Startup
+ {
+ public void Configure(IApplicationBuilder app)
+ {
+ var magicOnion = app.ApplicationServices.GetService<MagicOnionServiceDefinition>();
+
+ var xmlName = "Sandbox.ConsoleServerDefinition.xml";
+ var xmlPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), xmlName);
+
+ app.UseMagicOnionSwagger(magicOnion.MethodHandlers, new SwaggerOptions("MagicOnion.Server", "Swagger Integration Test", "/")
+ {
+ XmlDocumentPath = xmlPath
+ });
+ app.UseMagicOnionHttpGateway(magicOnion.MethodHandlers, new Channel("localhost:12345", ChannelCredentials.Insecure));
}
}
}
Oops, something went wrong.

0 comments on commit 9b0993b

Please sign in to comment.