Skip to content

Instantly share code, notes, and snippets.

@zot24
Last active January 3, 2017 15:18
Show Gist options
  • Select an option

  • Save zot24/3cf6df65c8ae3e63c2deabc4ed7174b9 to your computer and use it in GitHub Desktop.

Select an option

Save zot24/3cf6df65c8ae3e63c2deabc4ed7174b9 to your computer and use it in GitHub Desktop.
Inject JSON file as a body of a response with mountbank
{
"data":{
"type":"settings",
"page_length":100,
"email_smtp_port":25,
"email_encryption":"none",
"timezone":"UTC",
"password_policy":"min_6_letters"
}
}
{
"protocol": "http",
"port": 4542,
"requests": [],
"name": "settings",
"stubs": [
{
"responses": [
{
"inject": "<%- stringify(filename, 'services/settings/response.ejs') %>"
}
]
}
]
}
{
"imposters": [
<% include services/settings/data.ejs %>
]
}
function (request, state, logger) {
return {
headers: {
'Content-Type': 'application/json'
},
body: '<%- stringify(filename, 'services/settings/body.ejs') %>'
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment