Skip to content

Commit

Permalink
[freya] proof that Freya.Lenses.Http works
Browse files Browse the repository at this point in the history
  • Loading branch information
panesofglass committed Dec 8, 2015
1 parent 40513b3 commit dba282a
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions examples/Freya/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,31 @@ module SampleApp =
Languages = Some [ en ] }
Data = Encoding.UTF8.GetBytes x }

let ok =
Freya.Optic.set Response.reasonPhrase_ (Some "Hey Folks!")
*> Freya.init (represent "Hey, folks!")
let ok = freya {
do! Freya.Optic.set Response.reasonPhrase_ (Some "Hey Folks!")
let! stream = Freya.Optic.get Response.body_
let out = "Hello, folks!"B
stream.Write(out, 0, out.Length)
}
//*> Freya.init (represent "Hey, folks!")

let common =
freyaMachine {
using http
charsetsSupported Charset.Utf8
languagesSupported en
mediaTypesSupported MediaType.Text }

let home =
freyaMachine {
using http
//including common
methodsSupported GET
handleOk ok }
// let common =
// freyaMachine {
// using http
// charsetsSupported Charset.Utf8
// languagesSupported en
// mediaTypesSupported MediaType.Text }
//
// let home =
// freyaMachine {
// using http
// //including common
// methodsSupported GET
// handleOk ok }

let routes =
freyaRouter {
resource "/" home }
resource "/" ok }

module SelfHostedServer =
open Freya.Core
Expand Down

0 comments on commit dba282a

Please sign in to comment.