Skip to content

Commit e76cd59

Browse files
committed
init-repo
1 parent f26d3b8 commit e76cd59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+35801
-0
lines changed
Binary file not shown.

ChatSample/.vs/ChatSample/config/applicationhost.config

Lines changed: 999 additions & 0 deletions
Large diffs are not rendered by default.

ChatSample/.vs/ChatSample/v16/.suo

36.5 KB
Binary file not shown.

ChatSample/.vs/ChatSample/v16/Server/sqlite3/db.lock

Whitespace-only changes.
Binary file not shown.

ChatSample/ChatSample.sln

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26831.0
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChatSample", "ChatSample\ChatSample.csproj", "{CD9DEA65-E315-4BA5-B8F6-66EEDCCB1223}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{52C4A1E5-78AA-4475-9F8B-742427E42811}"
9+
ProjectSection(SolutionItems) = preProject
10+
EndProjectSection
11+
EndProject
12+
Global
13+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
14+
Debug|Any CPU = Debug|Any CPU
15+
Release|Any CPU = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{CD9DEA65-E315-4BA5-B8F6-66EEDCCB1223}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19+
{CD9DEA65-E315-4BA5-B8F6-66EEDCCB1223}.Debug|Any CPU.Build.0 = Debug|Any CPU
20+
{CD9DEA65-E315-4BA5-B8F6-66EEDCCB1223}.Release|Any CPU.ActiveCfg = Release|Any CPU
21+
{CD9DEA65-E315-4BA5-B8F6-66EEDCCB1223}.Release|Any CPU.Build.0 = Release|Any CPU
22+
EndGlobalSection
23+
GlobalSection(SolutionProperties) = preSolution
24+
HideSolutionNode = FALSE
25+
EndGlobalSection
26+
GlobalSection(ExtensibilityGlobals) = postSolution
27+
SolutionGuid = {3213FEC9-E3E9-41AE-A017-7F511D4DE8E4}
28+
EndGlobalSection
29+
EndGlobal
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.AspNetCore.App" />
9+
</ItemGroup>
10+
11+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
5+
</PropertyGroup>
6+
</Project>

ChatSample/ChatSample/Hubs/ChatHub.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using Microsoft.AspNetCore.SignalR;
2+
3+
namespace ChatSample.Hubs
4+
{
5+
public class ChatHub : Hub
6+
{
7+
public void Send(string name, string message)
8+
{
9+
// Call the broadcastMessage method to update clients.
10+
Clients.All.SendAsync("broadcastMessage", name, message);
11+
}
12+
}
13+
}

ChatSample/ChatSample/Program.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using Microsoft.AspNetCore;
2+
using Microsoft.AspNetCore.Hosting;
3+
4+
namespace ChatSample
5+
{
6+
public class Program
7+
{
8+
public static void Main(string[] args)
9+
{
10+
CreateWebHostBuilder(args).Build().Run();
11+
}
12+
13+
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
14+
WebHost.CreateDefaultBuilder(args)
15+
.UseStartup<Startup>();
16+
}
17+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:50704/",
7+
"sslPort": 0
8+
}
9+
},
10+
"profiles": {
11+
"IIS Express": {
12+
"commandName": "IISExpress",
13+
"launchBrowser": true,
14+
"environmentVariables": {
15+
"ASPNETCORE_ENVIRONMENT": "Development"
16+
}
17+
},
18+
"ChatSample": {
19+
"commandName": "Project",
20+
"launchBrowser": true,
21+
"environmentVariables": {
22+
"ASPNETCORE_ENVIRONMENT": "Development"
23+
},
24+
"applicationUrl": "http://localhost:50705/"
25+
}
26+
}
27+
}

ChatSample/ChatSample/Startup.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using ChatSample.Hubs;
2+
using Microsoft.AspNetCore.Builder;
3+
using Microsoft.AspNetCore.Hosting;
4+
using Microsoft.Extensions.DependencyInjection;
5+
6+
namespace ChatSample
7+
{
8+
public class Startup
9+
{
10+
// This method gets called by the runtime. Use this method to add services to the container.
11+
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
12+
public void ConfigureServices(IServiceCollection services)
13+
{
14+
services.AddCors();
15+
services.AddSignalR();
16+
}
17+
18+
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
19+
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
20+
{
21+
if (env.IsDevelopment())
22+
{
23+
app.UseDeveloperExceptionPage();
24+
}
25+
26+
app.UseFileServer();
27+
28+
app.UseCors(builder => builder
29+
.AllowAnyHeader()
30+
.AllowAnyMethod()
31+
.SetIsOriginAllowed((host) => true)
32+
.AllowCredentials()
33+
);
34+
app.UseSignalR(routes =>
35+
{
36+
routes.MapHub<ChatHub>("/chat");
37+
});
38+
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)