feathers-virtual-attribute-hook
This is experiment. Work in progress!
Feathers hook for add virtual attributes to your service response.
const addVirtualAttribute = app
Example
Look example folder for more information.
Test request:
curl -H "Accept: application/json" http://localhost:3030/messages
Server response example:
[
{
"id": 1,
"text": "A message with ID: 1!",
"webUrl": "http://example.com/messages/1"
},
{
"id": 2,
"text": "A message with ID: 2!",
"webUrl": "http://example.com/messages/2"
},
{
"id": 3,
"text": "A message with ID: 3!",
"webUrl": "http://example.com/messages/3"
}
]
Test request:
curl -H "Accept: application/json" http://localhost:3030/messages/1
Server response example:
{
"id": "1",
"text": "A new message with ID: 1!",
"webUrl": "http://example.com/messages/1"
}