I think this will be quick answer, but I couldn't find the right answer during today. I trying create F# SignalR Self-Host application ( I followed this tutorial http://www.asp.net/signalr/overview/signalr-20/getting-started-with-signalr-20/tutorial-signalr-20-self-host)
The outcome is my application don't map signalr/hubs on my localhost, there is no error message (only from JavaScript file when it doesn't find client).
namespace Program
open Owin
open Dynamic
open Microsoft.AspNet.SignalR
open Microsoft.AspNet.SignalR.Hubs
open Microsoft.Owin.Hosting
open Microsoft.Owin.Cors
open System
open System.Diagnostics
type MyHub =
inherit Hub
member x.Send (name : string) (message : string) =
base.Clients.All?addMessage name message
type MyWebStartUp() =
member x.Configuration (app :IAppBuilder) =
app.UseCors CorsOptions.AllowAll |> ignore
app.MapSignalR() |> ignore
()
module Starter =
[<EntryPoint>]
let main argv =
let hostUrl = "http://localhost:8085"
let disposable = WebApp.Start<MyWebStartUp>(hostUrl)
Console.WriteLine("Server running on "+ hostUrl)
Console.ReadLine() |> ignore
disposable.Dispose()
0 // return an integer exit code
I created C# application first and it does work perfectly, I assume my F# code is not right, but I cannot find that bug. For reference here is whole project: https://github.com/MartinBodocky/SignalRFSharp