Commit 199ad621 authored by Marc Gravell's avatar Marc Gravell

get a little further with kestrel

parent 78a37102
...@@ -22,4 +22,5 @@ StackExchange.Redis.*.zip ...@@ -22,4 +22,5 @@ StackExchange.Redis.*.zip
test-results*.xml test-results*.xml
packages/ packages/
StackExchange.Redis.Tests/*Config.json StackExchange.Redis.Tests/*Config.json
t8.shakespeare.txt t8.shakespeare.txt
\ No newline at end of file launchSettings.json
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework> <TargetFramework>netcoreapp2.1</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn> <NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.2" /> <Folder Include="wwwroot\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<ProjectReference Include="..\StackExchange.Redis.Server\StackExchange.Redis.Server.csproj" /> <ProjectReference Include="..\StackExchange.Redis.Server\StackExchange.Redis.Server.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -15,11 +15,15 @@ public static void Main(string[] args) ...@@ -15,11 +15,15 @@ public static void Main(string[] args)
WebHost.CreateDefaultBuilder(args) WebHost.CreateDefaultBuilder(args)
.UseKestrel(options => .UseKestrel(options =>
{ {
// HTTP 5000
options.ListenLocalhost(5000);
// TCP 6379 // TCP 6379
options.ListenLocalhost(8007, builder => options.ListenLocalhost(6379, builder =>
{ {
builder.UseConnectionHandler<RedisConnectionHandler>(); builder.UseConnectionHandler<RedisConnectionHandler>();
}); });
}); }).UseStartup<Startup>();
} }
} }
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
namespace KestrelRedisServer
{
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)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Run(async (context) =>
{
await context.Response.WriteAsync("Redis-ish server should be running");
});
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment