Book Image

SignalR: Real-time Application Development - Second Edition

By : Einar Ingerbrigsten
Book Image

SignalR: Real-time Application Development - Second Edition

By: Einar Ingerbrigsten

Overview of this book

Table of Contents (19 chapters)
SignalR – Real-time Application Development Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
11
Hosting a Server Using Self-hosted OWIN
Index

Putting the infrastructure in place


First of all, since our web application is built from HTML files and not ASPX or ASP.NET MVC controllers, we need to be able to have security in place for these as well, so we get redirected to a login page when not authenticated. There are a couple of approaches one can choose in order to make the security pipeline of ASP.NET kick in for static files such as HTML files; one of the approaches could be to enable all the HTTP modules to run for all the requests, but that would mean a potential performance hit for static content. So instead, we're going to tell ASP.NET to deal with the .html files specifically:

  1. We will need to do a few changes to the Web.config file sitting in the web project to accomplish this. In the compilation tag sitting at the top, we need to add the page build providers for the extensions we want to support:

    <compilation debug="true" targetFramework="4.5">
      <buildProviders>
        <add extension=".html" type="System.Web...