serverless
Version:
Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more
16 lines (14 loc) • 383 B
JavaScript
;
module.exports.handler = (event, context, callback) => {
const httpData = event.requestContext.http;
const resolve = () =>
callback(null, {
statusCode: 200,
body: JSON.stringify({
path: httpData.path,
method: httpData.method,
}),
});
if (httpData.path === '/bar/timeout') setTimeout(resolve, 2000);
else resolve();
};