Skip to content

MorganPersson/Fancy

Repository files navigation

Fancy

Wrist friendly F# for Nancy.

Install

Install-Package Fancy

Defining routes

there are 6 methods defining the http methods (or verbs) get, post, put, delete, patch and options They all share the same definition, string->f:(INancyModule->'a)->unit

the first parameter is a string, it's a Nancy route. the second parameter is a function which take a parameter of type INancyModule and a generic parameter 'a. And finally it returns unit.

Examples

get "/" (fun _ -> "Hello world!")

get "/greet/{name}" (fun http name ->
  let t = sprintf "At %s: Hello %s" (DateTime.Now) name
  http.Response
      .AsJson t
)

get "/many/{x}/{y}/{z}" (fun (x:string) (y:int) (z:string) -> () )

Contribute

We would love your help. Send us patches, report/fix bugs, request features etc.

Licence

Fancy is licensed under BSD 3

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published