mountebank
mountebank copied to clipboard
Allow SQL lookups
Like the CSV lookups, allow looking up values from SQL and replacing response tokens
Maybe something like this:
{
"is": {
"statusCode": "${row}['code']",
"headers": {
"X-Tree": "${row}['tree']"
},
"body": "Hello ${row}['Name'], have you done your ${row}['jobs'] today?"
},
"_behaviors": {
"lookup": [{
"key": {
"from": "path",
"using": { "method": "regex", "selector": "/(.*)$" },
"index": 1
},
"fromDataSource": {
"sql": {
"connectionString": "...",
"keyColumn": "Name"
}
},
"into": "${row}"
}]
}
}