@rlyle1179/serverless-aws-batch 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/schedule.js +8 -0
- package/package.json +1 -1
package/lib/schedule.js
CHANGED
|
@@ -59,10 +59,17 @@ module.exports.schedule = (event, context, callback) => {
|
|
|
59
59
|
batch.submitJob(params, function(err, data) {
|
|
60
60
|
let response;
|
|
61
61
|
|
|
62
|
+
const jsonHeaders = {
|
|
63
|
+
'Content-Type': 'application/json',
|
|
64
|
+
'Access-Control-Allow-Origin': '*', // Required for CORS support to work
|
|
65
|
+
'Access-Control-Allow-Credentials': true // Required for cookies, authorization headers with HTTPS
|
|
66
|
+
}
|
|
67
|
+
|
|
62
68
|
if (err) {
|
|
63
69
|
console.log(`Error submitting job: ${err}`, err.stack);
|
|
64
70
|
response = {
|
|
65
71
|
statusCode: 500,
|
|
72
|
+
headers: jsonHeaders,
|
|
66
73
|
body: JSON.stringify({
|
|
67
74
|
'error': err
|
|
68
75
|
})
|
|
@@ -72,6 +79,7 @@ module.exports.schedule = (event, context, callback) => {
|
|
|
72
79
|
console.log(`Submitted job: ${JSON.stringify(data, null, 2)}`);
|
|
73
80
|
response = {
|
|
74
81
|
statusCode: 200,
|
|
82
|
+
headers: jsonHeaders,
|
|
75
83
|
body: JSON.stringify({
|
|
76
84
|
data
|
|
77
85
|
})
|