0
使用Sails.js Generate創建API非常簡單。獲取this tutorial example,運行如何自動解析Sails.js路徑上的模型屬性?
curl -X GET http://localhost:1337/employee/1
回報
{
"id": 1,
"name": "John Smith",
"email" "[email protected]",
"empnum" "123",
"createdAt" "2015-10-25T19:25:16.559Z",
"updatedAt" "2015-10-25T19:25:16.559Z",
}
和
curl -X GET http://localhost:1337/employee/1?fields=name
將返回
{
"name": "John Smith"
}
不是傳遞一個字段數組,我怎麼可以配置Sails.js到r esolve像子資源路徑:
curl -X GET http://localhost:1337/employee/1/name