suave

Suave - Control when responses are 'cached' or recalculated

夙愿已清 提交于 2019-12-12 10:56:28
问题 I want to understand how to control when responses are 'cached' versus when they are 'recalculated'. As an example: [<EntryPoint>] let main [| port |] = let config = { defaultConfig with bindings = [ HttpBinding.mk HTTP IPAddress.Loopback (uint16 port) ] listenTimeout = TimeSpan.FromMilliseconds 3000. } let appDemo:WebPart = DateTime.Now.ToString() |> sprintf "Server timestamp: %s" |> Successful.OK startWebServer config appDemo If I run the above webserver and hit it several times then each

Deploy WebSharper.Suave web application to Heroku

岁酱吖の 提交于 2019-12-10 21:09:42
问题 I can not understand what I need to change to make it. I created a demo project from this blogpost with app.json and Procfile: web: fsharpi-heroku WebsahrperSuaveHerokuExample1.sln Next, I tried to deploy it to Heroku in accordance with these recommendations: heroku create websahrper-with-suave-example --buildpack https://github.com/SuaveIO/mono-script-buildpack.git heroku git:remote -a websahrper-with-suave-example git push heroku master There was an error in Heroku when building the project

How to set a Json response in suave webpart

烈酒焚心 提交于 2019-12-05 14:18:30
i'm begining with Suave and F#. I'm trying to pass a json serialized object in my webpart to get it in my response. In php i have this <?php header('Access-Control-Allow-Credentials:true'); header('Access-Control-Allow-Headers:Content-Type, Accept'); header('Access-Control-Allow-Methods:GET, POST, PUT, DELETE, OPTIONS'); header('Access-Control-Allow-Origin:*'); ?> { "player1Key":"hdegftzj25", "gameKey":"aegfhzkfszl74852" } and with this i get my json object, then i tried to do the same with Suave and Newtonsoft.Json type gameCreate= { player1Key : string gameKey: string } let create= {

Why can't I get Suave to work on VS 2017?

瘦欲@ 提交于 2019-12-01 19:49:57
I saw a video on https://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Visual-F-Tools where a project using Suave is created. I tried to follow exactly what was being done but my installation of VS 2017, just updated today, behaves quite differently. First I installed Suave exactly like in the video, and it appears among my references, between mscorlib and System , just like in the video. Then the video shows the following code: [<EntryPoint>] let main argv = startWebServer 0 // return an integer exit code At this point VS 2017 suggests "Open Suave" in the video, since startWebServer is not

Why can't I get Suave to work on VS 2017?

天大地大妈咪最大 提交于 2019-12-01 19:38:11
问题 I saw a video on https://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Visual-F-Tools where a project using Suave is created. I tried to follow exactly what was being done but my installation of VS 2017, just updated today, behaves quite differently. First I installed Suave exactly like in the video, and it appears among my references, between mscorlib and System , just like in the video. Then the video shows the following code: [<EntryPoint>] let main argv = startWebServer 0 // return an

Suave.io: using pathScan and request together

戏子无情 提交于 2019-12-01 04:43:19
I'm just getting up and running with Suave.io. I'm sure this will become clearer as I dig more into Applicatives - but from a high level I can't see how to write a pathScan rule that applies the request applicative too. All examples I'm found only do one or the other. In both cases they are applied to a function taking arguments - so presumably the arguments would be combined somehow too. Both pathScan and request take a function that produces a web part, so they cannot be nicely chained using >>= . Instead, you can nest one inside the other (I think the order does not really matter here):

Suave.io: using pathScan and request together

落花浮王杯 提交于 2019-12-01 03:06:47
问题 I'm just getting up and running with Suave.io. I'm sure this will become clearer as I dig more into Applicatives - but from a high level I can't see how to write a pathScan rule that applies the request applicative too. All examples I'm found only do one or the other. In both cases they are applied to a function taking arguments - so presumably the arguments would be combined somehow too. 回答1: Both pathScan and request take a function that produces a web part, so they cannot be nicely chained