andrewevans0102 / azure-signalr2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

azure-signalr2

This is the sample project for my post Connecting Microsoft SignalR with Angular.

This project connects the Azure SingalR Service to an Angular application.

In the azure folder there are two functions defined:

  1. negotiate which handles the initial SignalR handshake
  2. messages which handles actually transmitting messages via SignalR

In order to run this locally with an instance of Azure SignalR you need to add your Azure Functions base URL to the environment variable in /src/environments/environment:

export const environment = {
  production: false,
  azureConnection: "<AZURE_CONNECTION>",
};

If you want to run the functions locally, you'll also need to include your AzureSignalRConnectionString in the file /azure/local.settings.json like so:

{
  "IsEncrypted": false,
  "Values": {
    "AzureSignalRConnectionString": "<CONNECTION_STRING_LOCAL_HOST>",
    "FUNCTIONS_WORKER_RUNTIME": "node"
  },
  "Host": {
    "LocalHttpPort": 7071,
    "CORS": "*",
    "CORSCredentials": false
  }
}

Feel free to follow me on andrewevans.dev and on Twitter at @AndrewEvans0102.

About

License:MIT License


Languages

Language:TypeScript 75.9%Language:HTML 8.4%Language:SCSS 8.1%Language:JavaScript 7.6%