commit 2cce9634b333a8542341b876d03f72df2466f30c Author: Anuj Sahu Date: Thu Sep 18 06:55:11 2025 +0000 code update recorded at: 18/09/25 06:55:11 diff --git a/handler.js b/handler.js new file mode 100644 index 0000000..e0716b3 --- /dev/null +++ b/handler.js @@ -0,0 +1,25 @@ +d// Define the handler function +export const handler = async (event, res) => { + try { + // Prepare the response JSON + const responseJson = { + message: "Hello World" + }; + + // Print the JSON response to stdout + console.log(JSON.stringify(responseJson)); + + // Set the response headers + res.setHeader('Content-Type', 'application/json'); + + // Send the response JSON + res.end(JSON.stringify(responseJson)); + } catch (error) { + // Handle errors + console.error(error); + // Send an error response if needed + res.statusCode = 500; + res.setHeader('Content-Type', 'text/plain'); + res.end('Internal Server Error'); + } +};