I cannot figure out how to configure the router for the path, for example:
/store/category/%s/brand/%s
I have a web store demo and it works for simple URLs, but I don’t see how to create more flexible configurations.
This is what I have:
type StrPath = PrintfFormat<(string -> string),unit,string,string,string>
type Str2Path = PrintfFormat<(string -> string),unit,string,string,string>
let withParam (key,value) path = sprintf "%s?%s=%s" path key value
module Store =
let browseBrand = sprintf "/store/category/%s/brand/%s"
let browseCategory : StrPath = "/store/category/%s"
let browseBrand cat brand = request (fun r ->
Views.browse(cat brand))
let webPart =
localizeUICulture >>
choose [
path Path.Store.overview >=> overview
pathScan Path.Store.browseBrand browseBrand
pathScan Path.Store.browseCategory browseCategory
mamcx source
share