mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
20 lines
512 B
JavaScript
20 lines
512 B
JavaScript
'use strict'
|
|
|
|
function minimal(event, context, callback) {
|
|
// eslint-disable-next-line no-console
|
|
console.info('Event type', event.requestContext.eventType)
|
|
// eslint-disable-next-line no-console
|
|
if (event.body) console.info('Event body', event.body)
|
|
return callback(null, { statusCode: 200 })
|
|
}
|
|
|
|
function sayHello(event, context, callback) {
|
|
const body = JSON.parse(event.body)
|
|
return callback(null, { statusCode: 200, body: `Hello, ${body.name}` })
|
|
}
|
|
|
|
module.exports = {
|
|
minimal,
|
|
sayHello,
|
|
}
|