Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
SignalR Blueprints

You're reading from   SignalR Blueprints Build real-time ASP.NET web applications with SignalR and create various interesting projects to improve your user experience

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781783983124
Length 244 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Einar Ingerbrigsten Einar Ingerbrigsten
Author Profile Icon Einar Ingerbrigsten
Einar Ingerbrigsten
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. The Primer FREE CHAPTER 2. Overheating the Discussion 3. Extra! Extra! Read All About It! 4. Can You Measure It? 5. What Line of Business Are You In? 6. An Architectural Taste 7. The Three Screens – Mobile First 8. Putting the X in .NET – Xamarin 9. Debugging or Troubleshooting 10. Hosting and Deployment Index

Preparing our web application for SignalR

We now have the dependencies set up as required so all we need now is to prepare our web application for SignalR.

Making your SignalR hubs available for the client

Any hubs that we create need to be exposed to any connecting client so that they can be used. Let's start by exposing any SignalR hubs that we add from this point to automatically be available for our client. Open up the Startup.cs file. At the bottom of the Configuration method, we need to add a call to map any SignalR hubs, as shown in the following code:

public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
App.MapSignalR();
}

Note

It's possible to specify a base URL in the MapSignalR() method call that enables you to expose SignalR at whichever route you see fit.

By default, SignalR uses something called Open Web Interface for .NET (OWIN) and it needs to be told what the starting point is. Notice this is at the top of the Startup.cs file, above the namespace declaration...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image