INNER CODE UNIT · JavaScript
createEvent
fastify/aws-lambda-fastify · performanceTest/test.js:7
const createEvent = () => ({
httpMethod: 'GET',
rawPath: '/test',
path: '/test',
headers: {},
multiValueHeaders: {},
requestContext: { requestId: 'requestId', http: { method: 'GET' }, identity: { sourceIp: '0.0.0.0' } },
queryStringParameters: null,
multiValueQueryStringParameters: null
})
// @fastify/aws-lambda stuff:
const awsLambdaFastify = require('../index')
const appAwsLambdaFastify = fastify()
appAwsLambdaFastify.get('/test', async () => ({ hello: 'world' }))
const proxy = awsLambdaFastify(appAwsLambdaFastify)
// aws-serverless-express stuff: