@hybridless/hybridless 0.0.84-alpha12 → 0.0.84-alpha14
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/package.json
CHANGED
|
@@ -10,4 +10,4 @@ WORKDIR /usr/src/app
|
|
|
10
10
|
RUN cd /usr/src/hybridless-runtime/ && npm i -S @hybridless/runtime-nodejs-httpd@latest
|
|
11
11
|
|
|
12
12
|
# Run the specified command within the container.
|
|
13
|
-
ENTRYPOINT node
|
|
13
|
+
ENTRYPOINT node ../hybridless-runtime/proxy.js
|
|
@@ -5,20 +5,25 @@ process.on('SIGINT', function() {
|
|
|
5
5
|
});
|
|
6
6
|
//Execution scope
|
|
7
7
|
(async () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
try {
|
|
9
|
+
//Get inputs
|
|
10
|
+
let input = {};
|
|
11
|
+
try { input = JSON.parse(process.argv[2]); }
|
|
12
|
+
catch (e) { console.log('[Hybridless Runtime] - Error while decoding inputEvent parameter!', e); }
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
//Init lambda event and call it
|
|
15
|
+
const LambdaEvent = require("@hybridless/runtime-nodejs-httpd").LambdaEvent;
|
|
16
|
+
const functionPath = `${__dirname}/../app/${process.env.ENTRYPOINT}`;
|
|
17
|
+
const lambda = new LambdaEvent({ payload: input }, functionPath, process.env.ENTRYPOINT_FUNC);
|
|
18
|
+
//Callout
|
|
19
|
+
const resp = await lambda.invoke();
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
//Return
|
|
22
|
+
console.log(resp);
|
|
23
|
+
if (resp.getCode && resp.getCode() == 200) process.exit(0);
|
|
24
|
+
else process.exit(1);
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error(e);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
24
29
|
})();
|