-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.js
24 lines (23 loc) · 1.03 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var runner = require('./src/runner');
// App entry Point
exports.handler = function (event, context) {
console.log('Running index.handler');
console.log('==================================================');
console.log('event', event);
console.log('==================================================');
var filename = 'sample-script.js'; // file should be placed inside /src/scripts/
var args = { // attach & pass this data to sample-script.js
'email': '[email protected]',
'password': '12345',
// etc..
};
console.log('Executing file named: ', filename, 'with parameters:', JSON.stringify(args));
console.log('==================================================');
// Execute the casperJS script and exit.
runner(filename, args, function(err, data) {
console.log('==================================================');
console.log('Stopping index.handler');
context.done();
console.log('==================================================');
});
};