Last active
January 3, 2017 15:18
-
-
Save zot24/3cf6df65c8ae3e63c2deabc4ed7174b9 to your computer and use it in GitHub Desktop.
Inject JSON file as a body of a response with mountbank
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "data":{ | |
| "type":"settings", | |
| "page_length":100, | |
| "email_smtp_port":25, | |
| "email_encryption":"none", | |
| "timezone":"UTC", | |
| "password_policy":"min_6_letters" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "protocol": "http", | |
| "port": 4542, | |
| "requests": [], | |
| "name": "settings", | |
| "stubs": [ | |
| { | |
| "responses": [ | |
| { | |
| "inject": "<%- stringify(filename, 'services/settings/response.ejs') %>" | |
| } | |
| ] | |
| } | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "imposters": [ | |
| <% include services/settings/data.ejs %> | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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