Skip to content

Commit

Permalink
SignalR, TS, and Webpack v6.0 (dotnet#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
serpent5 authored Mar 15, 2022
1 parent e523aa6 commit d5cf0e4
Show file tree
Hide file tree
Showing 18 changed files with 5,402 additions and 0 deletions.
454 changes: 454 additions & 0 deletions .gitignore

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wwwroot/
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);
}
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();
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"
}
}
}
}
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>
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
Loading

0 comments on commit d5cf0e4

Please sign in to comment.