test-git-fcz5-handler/handler.js

39 lines
1.1 KiB
JavaScript

/**
* Test Git Serverless Handler
* For backward compatibility testing
*/
exports.handler = async (event, context) => {
console.log("Handler invoked - Version 1.0");
console.log("Event:", JSON.stringify(event, null, 2));
// Get environment variables (these should come from UI settings)
const envVars = {
NODE_ENV: process.env.NODE_ENV || "not-set",
BOLT_APPLICATION_NAME: process.env.BOLT_APPLICATION_NAME || "not-set",
BOLT_APPLICATION_SLUG: process.env.BOLT_APPLICATION_SLUG || "not-set",
// Add any custom env vars set from UI here for testing
UI_TEST_VAR: process.env.UI_TEST_VAR || "not-set",
API_KEY: process.env.API_KEY || "not-set",
};
return {
statusCode: 200,
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
message: "Hello from test-git-fcz5-handler!",
version: "1.0.0",
timestamp: new Date().toISOString(),
environment: envVars,
testInfo: {
purpose: "Backward compatibility test",
bolticYamlFormat: "OLD (no serverlessConfig)",
expectedBehavior: "UI settings should be preserved after push",
},
}),
};
};