-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* inject-branch: (27 commits) updating netbeans to 8.1 updating documentation saving new copy of collection backups updating documentation saving new copy of collection backups linting display INJ for match based on injection adding second response to injector test backup js beautify doesn't minimize so handling separately working on response injection added catch all for posts fixed problem when path was set empty for match saved mountebank-UI configuration documentation 3 documentation 2 documentation added body formatting back to match body add verb to imposter selector buttons empty body for match and response css formatting for injection areas 2 css formatting for injection areas adding help adding js formatting formatting ...
- Loading branch information
Showing
27 changed files
with
2,121 additions
and
417 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,5 +10,5 @@ bower_components | |
/public_html/mountebank-UI/assets/js/ | ||
/reports/ | ||
/mb.pid | ||
/mb.log | ||
/mb*.log | ||
/build/ |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
|
||
|
||
function processRequest(request, logger) { | ||
|
||
|
||
var handlebars = require('handlebars'); | ||
var JSON = require("JSON3") | ||
var sentIn = JSON.stringify(request,null); | ||
// logger.info('sentIn'); | ||
|
||
var source = '{"book": "{{title}}","publication": {{year}}, "ISBN": "{{random}}" }'; | ||
var ran = Math.floor(1053 + Math.random() * 124 + .5) + "-ADGJK-" + Math.floor(1057 + Math.random() * 124 + .5) | ||
|
||
var data = { | ||
"title": "Anne of Green Gables", | ||
"year": 1985, | ||
"random": ran | ||
}; | ||
|
||
var template = handlebars.compile(source); | ||
var textJSON = template(data); | ||
//var jj = JSON.parse(html) | ||
// console.log(html); | ||
|
||
|
||
return { | ||
headers: { | ||
'Content-Type': 'application/json' | ||
}, | ||
body: textJSON, | ||
statusCode: 200 | ||
}; | ||
} | ||
var t = processRequest(); | ||
console.log(JSON.stringify(t,null,2)) |
Oops, something went wrong.