Skip to content

Commit d5cf0e4

Browse files
authored
SignalR, TS, and Webpack v6.0 (dotnet#1)
1 parent e523aa6 commit d5cf0e4

File tree

18 files changed

+5402
-0
lines changed

18 files changed

+5402
-0
lines changed

.gitignore

Lines changed: 454 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wwwroot/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Microsoft.AspNetCore.SignalR;
2+
3+
namespace SignalRWebpack.Hubs;
4+
5+
public class ChatHub : Hub
6+
{
7+
public async Task NewMessage(long username, string message) =>
8+
await Clients.All.SendAsync("messageReceived", username, message);
9+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// <snippet_HubsNamespace>
2+
using SignalRWebpack.Hubs;
3+
// </snippet_HubsNamespace>
4+
5+
// <snippet_AddSignalR>
6+
var builder = WebApplication.CreateBuilder(args);
7+
8+
builder.Services.AddSignalR();
9+
// </snippet_AddSignalR>
10+
11+
// <snippet_FilesMiddleware>
12+
var app = builder.Build();
13+
14+
app.UseDefaultFiles();
15+
app.UseStaticFiles();
16+
// </snippet_FilesMiddleware>
17+
18+
// <snippet_MapHub>
19+
app.MapHub<ChatHub>("/hub");
20+
// </snippet_MapHub>
21+
22+
app.Run();
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:19614",
7+
"sslPort": 44392
8+
}
9+
},
10+
"profiles": {
11+
"SignalRWebpack": {
12+
"commandName": "Project",
13+
"dotnetRunMessages": true,
14+
"launchBrowser": true,
15+
"applicationUrl": "https://localhost:7268;http://localhost:5042",
16+
"environmentVariables": {
17+
"ASPNETCORE_ENVIRONMENT": "Development"
18+
}
19+
},
20+
"IIS Express": {
21+
"commandName": "IISExpress",
22+
"launchBrowser": true,
23+
"environmentVariables": {
24+
"ASPNETCORE_ENVIRONMENT": "Development"
25+
}
26+
}
27+
}
28+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net6.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="4.6.2">
11+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12+
<PrivateAssets>all</PrivateAssets>
13+
</PackageReference>
14+
</ItemGroup>
15+
16+
</Project>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.1.32228.430
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SignalRWebpack", "SignalRWebpack.csproj", "{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {38BAA5C6-7745-47DD-AE34-F5427256F76F}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
}
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning"
6+
}
7+
},
8+
"AllowedHosts": "*"
9+
}

0 commit comments

Comments
 (0)