Anyone have any issues getting lambda proxy to work? My function works fine when invoked locally and when running serverless-offline, but once I deploy, the function doesn’t return (however the log right before the callback logs out) and there aren’t any errors in Cloudwatch. It just say that the function timed out (at 15 seconds which is plenty long enough).
Any help would be greatly appreciated.
console.log('EXP: ', exp); // This logs in cloudwatch
return callback(null, {
statusCode: 200,
headers: {
'Set-Cookie': `x-jwt=${token}; expires=${exp}`,
'Access-Control-Allow-Origin' : "*", // Required for CORS support to work
'Access-Control-Allow-Credentials' : true // Required for cookies, authorization headers with HTTPS
}
});
- serverless.yml
service: wl-login-test
plugins:
- serverless-webpack
- serverless-offline
custom:
webpackIncludeModules: true
serverless-offline:
babelOptions:
presets: ["env"]
provider:
name: aws
runtime: nodejs6.10
stage: dev
region: us-east-1
timeout: 15
functions:
login:
handler: handler.login
environment:
SECRET: secret
TABLE_NAME: tableName
AWS_PROFILE: profile
POSTGRES_USER: user
POSTGRES_PASSWORD: pgPassword
POSTGRES_DB: dbName
POSTGRES_HOST: hostName
events:
- http:
path: login
method: post
cors: true