Using this awesome framework I wrote a very simple cloud function which fetches info from Belgium’s public radio and then maps that response out to something nicer to work with for dev stuff like apps / IoT / etc.
This was all working fine until I decided to try and use path parameters to dynamically get the broadcasting information for multiple channels. I simply tried to add a /{channelCode}
URL path param to fetch the correct channel info.
All this is working fine when I used serverless-offline to mimic the AWS API gateway but when I ran sls deploy -f vrt_api_mapper
it seems that the live URL does not recognize this valid path and replies with: "message": "Missing Authentication Token"
I’m using the following serverless.yml conf:
service:
name: aws-nodejs-ecma-script
plugins:
- serverless-offline
- serverless-webpack
provider:
name: aws
runtime: nodejs8.10
functions:
vrt_api_mapper:
handler: mapper.handler
events:
- http:
method: get
cors: true
path: '/{channelCode}'
request:
parameters:
paths:
channelCode: true
The Node.js code that runs for the function is here: https://github.com/thibmaek/vrt-api-mapper/blob/master/mapper.js
Can anybody help me understand why this works fine in a local env but would not work once deployed to AWS Lambda? I also noticed AWS Lambda transforms the URL to: https://….amazonaws.com/dev/stubru