INNER CODE UNIT · JavaScript

serverFactory

fastify/aws-lambda-fastify · performanceTest/test.js:27

const serverFactory = (handler) => {
  server = awsServerlessExpress.createServer(handler)
  return server
}
const appAwsServerlessExpress = fastify({ serverFactory })
appAwsServerlessExpress.get('/test', async () => ({ hello: 'world' }))

// aws-serverless-fastify stuff:
const proxyAwsServerlessFastify = require('aws-serverless-fastify').proxy
const appAwsServerlessFastify = fastify()
appAwsServerlessFastify.get('/test', async () => ({ hello: 'world' }))

// serverless-http stuff:
const serverlessHttp = require('serverless-http')
const appServerlessHttp = fastify()
appServerlessHttp.get('/test', async () => ({ hello: 'world' }))
const serverlessHttpProxy = serverlessHttp(appServerlessHttp)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…