Created
September 3, 2015 16:01
-
-
Save granicz/8794dec65216087d14bd to your computer and use it in GitHub Desktop.
Running WebSharper on Suave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SelfHostedServer = | |
open global.Owin | |
open System.Net | |
open Suave | |
open Suave.Types | |
open Suave.Http.Successful | |
open Suave.Web | |
open Suave.Owin | |
open WebSharper.Owin | |
[<EntryPoint>] | |
let Main = function | |
| [| rootDirectory |] -> | |
let app = | |
SiteletMiddleware<_>.AsMidFunc(Options.Create(rootDirectory), Site.Main) | |
|> Suave.Owin.OwinApp.ofMidFunc | |
startWebServer defaultConfig app | |
0 | |
| _ -> | |
eprintfn "Usage: Application1 ROOT_DIRECTORY" | |
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.InvalidCastException: Unable to cast object of type 'Microsoft.FSharp.Collections.FSharpMap`2[System.String,System.Object]' to type 'System.String'. | |
at Microsoft.Owin.OwinRequest.Get[T](String key) | |
at Microsoft.Owin.OwinRequest.get_Host() | |
at Microsoft.Owin.OwinRequest.get_Uri() | |
at WebSharper.Owin.Internal.O2W.Request(IOwinRequest req) | |
at WebSharper.Owin.Internal.dispatch[T](ContextBuilder cb, Sitelet`1 s, IOwinContext context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[I] 2015-09-03T15:59:02.4169399Z: listener started in 15.625 ms with binding 127.0.0.1:8083 [Suave.Tcp.tcpIpServer] |
haf
commented
Sep 12, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment