| @@ -1,8 +0,0 @@ | |||
| <Project Sdk="Microsoft.NET.Sdk"> | |||
| <PropertyGroup> | |||
| <OutputType>Exe</OutputType> | |||
| <TargetFramework>net5.0</TargetFramework> | |||
| </PropertyGroup> | |||
| </Project> | |||
| @@ -1,12 +0,0 @@ | |||
| using System; | |||
| namespace Klijent | |||
| { | |||
| internal class Program | |||
| { | |||
| static void Main(string[] args) | |||
| { | |||
| Console.WriteLine("Hello World!"); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,31 +0,0 @@ | |||
| | |||
| Microsoft Visual Studio Solution File, Format Version 12.00 | |||
| # Visual Studio Version 17 | |||
| VisualStudioVersion = 17.2.32630.192 | |||
| MinimumVisualStudioVersion = 10.0.40219.1 | |||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Klijent", "Klijent\Klijent.csproj", "{A4642A38-757F-4C78-89AD-9D82840A71E5}" | |||
| EndProject | |||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "Server\Server.csproj", "{3038E97C-DE75-460F-B07D-BC7873BCADF1}" | |||
| EndProject | |||
| Global | |||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
| Debug|Any CPU = Debug|Any CPU | |||
| Release|Any CPU = Release|Any CPU | |||
| EndGlobalSection | |||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | |||
| {A4642A38-757F-4C78-89AD-9D82840A71E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
| {A4642A38-757F-4C78-89AD-9D82840A71E5}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
| {A4642A38-757F-4C78-89AD-9D82840A71E5}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
| {A4642A38-757F-4C78-89AD-9D82840A71E5}.Release|Any CPU.Build.0 = Release|Any CPU | |||
| {3038E97C-DE75-460F-B07D-BC7873BCADF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
| {3038E97C-DE75-460F-B07D-BC7873BCADF1}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
| {3038E97C-DE75-460F-B07D-BC7873BCADF1}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
| {3038E97C-DE75-460F-B07D-BC7873BCADF1}.Release|Any CPU.Build.0 = Release|Any CPU | |||
| EndGlobalSection | |||
| GlobalSection(SolutionProperties) = preSolution | |||
| HideSolutionNode = FALSE | |||
| EndGlobalSection | |||
| GlobalSection(ExtensibilityGlobals) = postSolution | |||
| SolutionGuid = {94D1D8F8-A619-4DBE-BAE7-65C459AC6CCA} | |||
| EndGlobalSection | |||
| EndGlobal | |||
| @@ -1,27 +0,0 @@ | |||
| using Microsoft.AspNetCore.Hosting; | |||
| using Microsoft.Extensions.Hosting; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.IO; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| namespace Server | |||
| { | |||
| public class Program | |||
| { | |||
| public static void Main(string[] args) | |||
| { | |||
| CreateHostBuilder(args).Build().Run(); | |||
| } | |||
| // Additional configuration is required to successfully run gRPC on macOS. | |||
| // For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682 | |||
| public static IHostBuilder CreateHostBuilder(string[] args) => | |||
| Host.CreateDefaultBuilder(args) | |||
| .ConfigureWebHostDefaults(webBuilder => | |||
| { | |||
| webBuilder.UseStartup<Startup>(); | |||
| }); | |||
| } | |||
| } | |||
| @@ -1,13 +0,0 @@ | |||
| { | |||
| "profiles": { | |||
| "Server": { | |||
| "commandName": "Project", | |||
| "dotnetRunMessages": "true", | |||
| "launchBrowser": false, | |||
| "applicationUrl": "http://localhost:5000;https://localhost:5001", | |||
| "environmentVariables": { | |||
| "ASPNETCORE_ENVIRONMENT": "Development" | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -1,21 +0,0 @@ | |||
| syntax = "proto3"; | |||
| option csharp_namespace = "Server"; | |||
| package greet; | |||
| // The greeting service definition. | |||
| service Greeter { | |||
| // Sends a greeting | |||
| rpc SayHello (HelloRequest) returns (HelloReply); | |||
| } | |||
| // The request message containing the user's name. | |||
| message HelloRequest { | |||
| string name = 1; | |||
| } | |||
| // The response message containing the greetings. | |||
| message HelloReply { | |||
| string message = 1; | |||
| } | |||
| @@ -1,15 +0,0 @@ | |||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | |||
| <PropertyGroup> | |||
| <TargetFramework>net5.0</TargetFramework> | |||
| </PropertyGroup> | |||
| <ItemGroup> | |||
| <Protobuf Include="Protos\greet.proto" GrpcServices="Server" /> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <PackageReference Include="Grpc.AspNetCore" Version="2.34.0" /> | |||
| </ItemGroup> | |||
| </Project> | |||
| @@ -1,26 +0,0 @@ | |||
| using Grpc.Core; | |||
| using Microsoft.Extensions.Logging; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| namespace Server | |||
| { | |||
| public class GreeterService : Greeter.GreeterBase | |||
| { | |||
| private readonly ILogger<GreeterService> _logger; | |||
| public GreeterService(ILogger<GreeterService> logger) | |||
| { | |||
| _logger = logger; | |||
| } | |||
| public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context) | |||
| { | |||
| return Task.FromResult(new HelloReply | |||
| { | |||
| Message = "Hello " + request.Name | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,43 +0,0 @@ | |||
| using Microsoft.AspNetCore.Builder; | |||
| using Microsoft.AspNetCore.Hosting; | |||
| using Microsoft.AspNetCore.Http; | |||
| using Microsoft.Extensions.DependencyInjection; | |||
| using Microsoft.Extensions.Hosting; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Threading.Tasks; | |||
| namespace Server | |||
| { | |||
| public class Startup | |||
| { | |||
| // This method gets called by the runtime. Use this method to add services to the container. | |||
| // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 | |||
| public void ConfigureServices(IServiceCollection services) | |||
| { | |||
| services.AddGrpc(); | |||
| } | |||
| // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | |||
| public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | |||
| { | |||
| if (env.IsDevelopment()) | |||
| { | |||
| app.UseDeveloperExceptionPage(); | |||
| } | |||
| app.UseRouting(); | |||
| app.UseEndpoints(endpoints => | |||
| { | |||
| endpoints.MapGrpcService<GreeterService>(); | |||
| endpoints.MapGet("/", async context => | |||
| { | |||
| await context.Response.WriteAsync("Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909"); | |||
| }); | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,10 +0,0 @@ | |||
| { | |||
| "Logging": { | |||
| "LogLevel": { | |||
| "Default": "Debug", | |||
| "System": "Information", | |||
| "Grpc": "Information", | |||
| "Microsoft": "Information" | |||
| } | |||
| } | |||
| } | |||
| @@ -1,15 +0,0 @@ | |||
| { | |||
| "Logging": { | |||
| "LogLevel": { | |||
| "Default": "Information", | |||
| "Microsoft": "Warning", | |||
| "Microsoft.Hosting.Lifetime": "Information" | |||
| } | |||
| }, | |||
| "AllowedHosts": "*", | |||
| "Kestrel": { | |||
| "EndpointDefaults": { | |||
| "Protocols": "Http2" | |||
| } | |||
| } | |||
| } | |||