Hi,
I’m Using nodejs with api gateway.
I have a stage configured called “dev”, and when printing out event.stage to console it comes up as “undefined”.
what am I missing?
Hi,
I’m Using nodejs with api gateway.
I have a stage configured called “dev”, and when printing out event.stage to console it comes up as “undefined”.
what am I missing?
What does your serverless.yml
look like?
Also, is console.log(event)
in your function logging an object or a string. Try console.log(typeof event)
to see
serverless.yml looks something like this:
provider:
name: aws
runtime: nodejs4.3
region: us-west-2
exclude:
- test.js
functions:
create:
handler: handler.create
memorySize: 128
description: "y"
events:
- http:
path: create
method: post
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
resources:
Resources: ${file(cloudformation-resources.json)}
and event is an object