为清楚起见进行了编辑
不知何故,这有效:
path "/" >=> warbler (fun _ -> OK (string DateTime.Now))
但是这个没有:
let txnAccA =
let sqlStr = "select JSON from Store.Txn"
let result = Db.execute sqlStr Config.oConnStr
match result with
| Some a ->
[for i in a do
let msg = JsonConvert.DeserializeObject<TxnAccA>(i)
yield msg
]
| _ ->
List.empty<TxnAccA>
let txnAmtA =
let sqlStr = "select JSON from Store.Amt"
let result = Db.execute sqlStr Config.oConnStr
match result with
| Some a ->
[for i in a do
let msg = JsonConvert.DeserializeObject<TxnAmtA>(i)
yield msg
]
| _ ->
List.empty<TxnAmtA>
let result ()= {Acc= txnAccA; Amt= txnAmtA}
path "/txn" >=> warbler (fun _ -> page "txn.html" (result()))
“作品”是指页面不是静态的,它显示来自数据库的最新数据。知道为什么吗?