forked from dotnet/aspnetcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SignalR, TS, and Webpack v6.0 (dotnet#1)
- Loading branch information
Showing
18 changed files
with
5,402 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
tutorials/signalr-typescript-webpack/samples/6.x/SignalRWebpack/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
wwwroot/ |
9 changes: 9 additions & 0 deletions
9
tutorials/signalr-typescript-webpack/samples/6.x/SignalRWebpack/Hubs/ChatHub.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Microsoft.AspNetCore.SignalR; | ||
|
||
namespace SignalRWebpack.Hubs; | ||
|
||
public class ChatHub : Hub | ||
{ | ||
public async Task NewMessage(long username, string message) => | ||
await Clients.All.SendAsync("messageReceived", username, message); | ||
} |
22 changes: 22 additions & 0 deletions
22
tutorials/signalr-typescript-webpack/samples/6.x/SignalRWebpack/Program.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// <snippet_HubsNamespace> | ||
using SignalRWebpack.Hubs; | ||
// </snippet_HubsNamespace> | ||
|
||
// <snippet_AddSignalR> | ||
var builder = WebApplication.CreateBuilder(args); | ||
|
||
builder.Services.AddSignalR(); | ||
// </snippet_AddSignalR> | ||
|
||
// <snippet_FilesMiddleware> | ||
var app = builder.Build(); | ||
|
||
app.UseDefaultFiles(); | ||
app.UseStaticFiles(); | ||
// </snippet_FilesMiddleware> | ||
|
||
// <snippet_MapHub> | ||
app.MapHub<ChatHub>("/hub"); | ||
// </snippet_MapHub> | ||
|
||
app.Run(); |
28 changes: 28 additions & 0 deletions
28
...ials/signalr-typescript-webpack/samples/6.x/SignalRWebpack/Properties/launchSettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"iisSettings": { | ||
"windowsAuthentication": false, | ||
"anonymousAuthentication": true, | ||
"iisExpress": { | ||
"applicationUrl": "http://localhost:19614", | ||
"sslPort": 44392 | ||
} | ||
}, | ||
"profiles": { | ||
"SignalRWebpack": { | ||
"commandName": "Project", | ||
"dotnetRunMessages": true, | ||
"launchBrowser": true, | ||
"applicationUrl": "https://localhost:7268;http://localhost:5042", | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
}, | ||
"IIS Express": { | ||
"commandName": "IISExpress", | ||
"launchBrowser": true, | ||
"environmentVariables": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
tutorials/signalr-typescript-webpack/samples/6.x/SignalRWebpack/SignalRWebpack.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="4.6.2"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
</Project> |
25 changes: 25 additions & 0 deletions
25
tutorials/signalr-typescript-webpack/samples/6.x/SignalRWebpack/SignalRWebpack.sln
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32228.430 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SignalRWebpack", "SignalRWebpack.csproj", "{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{6B723BC1-D66A-4C1B-A57F-0E80BF68E46E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {38BAA5C6-7745-47DD-AE34-F5427256F76F} | ||
EndGlobalSection | ||
EndGlobal |
8 changes: 8 additions & 0 deletions
8
tutorials/signalr-typescript-webpack/samples/6.x/SignalRWebpack/appsettings.Development.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
tutorials/signalr-typescript-webpack/samples/6.x/SignalRWebpack/appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |
Oops, something went wrong.