{"action":"created","issue":{"url":"https://api.github.com/repos/fastify/fastify/issues/1317","repository_url":"https://api.github.com/repos/fastify/fastify","labels_url":"https://api.github.com/repos/fastify/fastify/issues/1317/labels{/name}","comments_url":"https://api.github.com/repos/fastify/fastify/issues/1317/comments","events_url":"https://api.github.com/repos/fastify/fastify/issues/1317/events","html_url":"https://github.com/fastify/fastify/issues/1317","id":389777637,"node_id":"MDU6SXNzdWUzODk3Nzc2Mzc=","number":1317,"title":"Run Fastify in AWS Lambda","user":{"login":"MaxVinogradov","id":13771219,"node_id":"MDQ6VXNlcjEzNzcxMjE5","avatar_url":"https://avatars1.githubusercontent.com/u/13771219?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxVinogradov","html_url":"https://github.com/MaxVinogradov","followers_url":"https://api.github.com/users/MaxVinogradov/followers","following_url":"https://api.github.com/users/MaxVinogradov/following{/other_user}","gists_url":"https://api.github.com/users/MaxVinogradov/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxVinogradov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxVinogradov/subscriptions","organizations_url":"https://api.github.com/users/MaxVinogradov/orgs","repos_url":"https://api.github.com/users/MaxVinogradov/repos","events_url":"https://api.github.com/users/MaxVinogradov/events{/privacy}","received_events_url":"https://api.github.com/users/MaxVinogradov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-12-11T13:59:04Z","updated_at":"2018-12-11T14:12:40Z","closed_at":null,"author_association":"NONE","body":"## How can I run Fastify in AWS Lambda?\r\n\r\nFor now I'm using `aws-serverless-express`, with next code:\r\n\r\n```\r\nconst awsServerlessExpress = require('aws-serverless-express')\r\nconst Fastify = require('fastify')\r\n\r\nconst fastify_app = Fastify({\r\n  serverFactory: function (handler) {\r\n    return awsServerlessExpress.createServer(handler)\r\n  }\r\n})\r\n\r\n\r\nfastify_app.get('/1', async (req, reply) => {\r\n  console.log('!!!###');\r\n  try {\r\n\r\n    return reply.send({ hello: 'world' });\r\n  } catch (e) {\r\n    console.log(e)\r\n  }\r\n});\r\n\r\nexports.handler = async (event, context) => {\r\n  await fastify_app.ready();\r\n  fastify_app.ready(() => {\r\n    console.log('Ready');\r\n    const server = fastify_app.server;\r\n    return awsServerlessExpress.proxy(server, event, context);\r\n  });\r\n}\r\n\r\n```\r\n\r\nThen I run serverless-local, send request to endpoint, and see ` !!!###`, but I haven't any response. \r\n+  I see warning in the console:\r\n```\r\nServerless: Warning: handler 'user-news' returned a promise and also uses a callback!\r\nThis is problematic and might cause issues in your lambda.\r\n```\r\n\r\nCould you please check, what's wrong?"},"comment":{"url":"https://api.github.com/repos/fastify/fastify/issues/comments/446215858","html_url":"https://github.com/fastify/fastify/issues/1317#issuecomment-446215858","issue_url":"https://api.github.com/repos/fastify/fastify/issues/1317","id":446215858,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjIxNTg1OA==","user":{"login":"MaxVinogradov","id":13771219,"node_id":"MDQ6VXNlcjEzNzcxMjE5","avatar_url":"https://avatars1.githubusercontent.com/u/13771219?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxVinogradov","html_url":"https://github.com/MaxVinogradov","followers_url":"https://api.github.com/users/MaxVinogradov/followers","following_url":"https://api.github.com/users/MaxVinogradov/following{/other_user}","gists_url":"https://api.github.com/users/MaxVinogradov/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxVinogradov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxVinogradov/subscriptions","organizations_url":"https://api.github.com/users/MaxVinogradov/orgs","repos_url":"https://api.github.com/users/MaxVinogradov/repos","events_url":"https://api.github.com/users/MaxVinogradov/events{/privacy}","received_events_url":"https://api.github.com/users/MaxVinogradov/received_events","type":"User","site_admin":false},"created_at":"2018-12-11T14:12:40Z","updated_at":"2018-12-11T14:12:40Z","author_association":"NONE","body":"> user-news\r\n\r\n@mcollina it's only lambda endpoint name in serverless  framework"}}
{"actor":{"display_login":"MaxVinogradov"}}