Segue meu código abaixo:
org: luizfelipew
app: alura-activities
service: aws-node-http-api-project
frameworkVersion: '3'
params:
default:
dbName: alura-serverless
dev:
connectionString: mongodb://localhost:27017/${self:params.default.dbName}
prod:
provider:
name: aws
runtime: nodejs18.x
region: us-east-1
environment:
MONGODB_CONNECTIONSTRING: ${param:connectionString}
: ${param:dbName}
functions:
sendResponse:
handler: api/handlers.sendResponse
events:
- httpApi:
path: /api/results
method: post
request:
schemas:
applcation/json: ${file(./schemas/sendResponse.json)}
getResult:
handler: api/handlers.getResult
events:
- httpApi:
path: /api/results/{id}
method: get
plugins:
- serverless-offline
Erro apresentado no terminal:
Segue a imagem no serverless dashboard com a variável configurada: