diff --git a/creating-a-lambda-function-using-the-aws-console/index.js b/creating-a-lambda-function-using-the-aws-console/index.js deleted file mode 100644 index 126c01f..0000000 --- a/creating-a-lambda-function-using-the-aws-console/index.js +++ /dev/null @@ -1,10 +0,0 @@ -const https = require('https') -let url = "https://www.amazon.com" - -exports.handler = function(event, context, callback) { - https.get(url, (res) => { - callback(null, res.statusCode) - }).on('error', (e) => { - callback(Error(e)) - }) -} \ No newline at end of file diff --git a/creating-a-lambda-function-using-the-aws-console/nodejs-v16-index.js b/creating-a-lambda-function-using-the-aws-console/nodejs-v16-index.js new file mode 100644 index 0000000..53fa8f5 --- /dev/null +++ b/creating-a-lambda-function-using-the-aws-console/nodejs-v16-index.js @@ -0,0 +1,12 @@ +const https = require("https"); +let url = "https://www.amazon.com"; + +exports.handler = function (event, context, callback) { + https + .get(url, (res) => { + callback(null, res.statusCode); + }) + .on("error", (e) => { + callback(Error(e)); + }); +}; diff --git a/creating-a-lambda-function-using-the-aws-console/nodejs-v18-index.js b/creating-a-lambda-function-using-the-aws-console/nodejs-v18-index.js new file mode 100644 index 0000000..d2000fc --- /dev/null +++ b/creating-a-lambda-function-using-the-aws-console/nodejs-v18-index.js @@ -0,0 +1,12 @@ +import https from "node:https"; +let url = "https://www.amazon.com"; + +export function handler(event, context, callback) { + https + .get(url, (res) => { + callback(null, res.statusCode); + }) + .on("error", (e) => { + callback(Error(e)); + }); +}