code update recorded at: 29/04/26 08:04:04

This commit is contained in:
Anuj Sahu 2026-04-29 08:04:04 +00:00
commit 0ff2b5f31d

29
handler.js Normal file
View File

@ -0,0 +1,29 @@
// Define the handler function
export const handler = async (event, res) => {
try {
const a = 12;
const b = 12;
// Prepare the response JSON
const responseJson = {
message: `Hello World ${a + b}`
};
// 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');
}
};