Send console message with healthy render

This commit is contained in:
Kurt Hutten
2021-03-21 14:48:54 +11:00
parent cc1c0e7278
commit f9f35183af
6 changed files with 23 additions and 30 deletions

View File

@@ -45,11 +45,11 @@ const render = async (req, _context, callback) => {
console.log(image, 'encoded image')
const response = {
statusCode: 200,
headers: {
'content-type': 'image/png',
},
body: image,
isBase64Encoded: true,
body: JSON.stringify({
imageBase64: image,
result,
tempFile,
}),
}
callback(null, response)
}

View File

@@ -64,11 +64,11 @@ async function runCommand(command, timeout = 5000) {
}
if (stderr) {
console.log(`stderr: ${stderr}`)
resolve(`stderr: ${stderr}`)
resolve(stderr)
return
}
console.log(`stdout: ${stdout}`)
resolve(`stdout: ${stdout}`)
resolve(stdout)
})
setTimeout(() => {
reject('timeout')