Questions tagged [serverless-framework-offline]

20 questions
11
votes
3 answers

How to debug Serverless Offline in Visual Studio Code using another port?

I have two Serverless Offline "servers" which I need to run locally at same time. So I need to change the port of one of the servers. I run a server using Visual Studio Code debugger. The configs of the servers are in launch.json files. How can I…
7
votes
3 answers

AWS - API keys available on the Serverless Offline framework?

I use Serverless Offline to develop a Web project. I need of API Keys to access to resource on Serverless AWS Lamda. I have a serverless.yml with my service and my provider. In Postman, I access to my route…
7
votes
4 answers

serverless-offline optional path parameter

I'm trying to set up a GET request with an optional parameter but I get an error when I call the url locally without the optional parameter. It works fine online on lambda though. What did I do wrong? I'm using serverless version 1.24.1 with the…
5
votes
1 answer

Serverless offline response issue while sending JSON response in lambda function

var result = [{ count : 10, data : [{"id":11,"id":22}] }]; var response = { statusCode: 200, count: result.length, body: result }; …
5
votes
1 answer

Serverless get list of local functions

Scenario I'm writing unit tests for local Lambda Output. Instead of manually putting in the names of all the different lambda functions I'm wanting to dynamically generate the list. sls deploy list functions Will return the list of functions that…
5
votes
1 answer

CORS - Status 200 but error in Chrome devtools console

I have a problem with CORS, the problem is my code is executed (status 200) but I have an error in Google Chrome developer console. My code: function callUrl(url) { var xmlhttp = null; if (window.XMLHttpRequest) { xmlhttp = new…
4
votes
1 answer

VSCode breakpoints disabled (greyed-out) when working with Typescritp and Serverless Offline

I am developing some Lambda functions using serverless-framework. The serveless-framework has been installed globally. I am using Typescript and serverless-webpack. I am also using serverless-offline to test locally. Everything works fine except…
3
votes
1 answer

Lambda Serverless Nodejs - Getting "Internal server error" when callback is called inside a promise

I am trying to call the callback(null,response) inside .then() block of a promise. It works fine when i am using serverless offline but its giving error when using serverless. There are two scenarios: 1 Works fine (when deployed using serverless…
2
votes
1 answer

serverless-s3-local writing to real S3 bucket

I am using Serverless framework with the serverless-s3-local plugin to test my code during development. However, despite being in offline mode, the real S3 bucket is being written to. How can I alter my configuration to use a local fake s3 bucket…
1
vote
0 answers

Use "full" context variables for AWS APIGW in Serverless Offline

We have a use-case where we need to fetch the API key name from the request to APIGW. Looking in the logs for APIGW I can see the value in API Key ID in event.requestContext.identity.apiKeyId but this is not included in Serverless Offline. Is there…
Anders
  • 3,198
  • 1
  • 20
  • 43
1
vote
1 answer

graphiql UI is broken for Serverless/AWS-Lambda setup

Here's a reference setup of AWS Lambda and Serverless and GraphQL that i'm following: https://github.com/serverless/serverless-graphql-apollo I'm trying with yarn run start-server-lambda:offline to start the project offline, it does start without…
0
votes
0 answers

Serverless offline cannot resolve local secrets - Value not found at "self" source

When packaging/deploying my function, we use secrets in AWS Secrets Manager. This is fine when deployed but attempting to debug it locally with serverless offline is throwing errors. serverless.yml app: rest-api service: scripts provider: name:…
wmash
  • 4,032
  • 3
  • 31
  • 69
0
votes
0 answers

I want using fixed Endpoint with serverless-appsync-simulator

Is it possible to use domain or localhost with serverless-appsync-simulator endpoint? I don't want the endpoint to change. When I start simulator, it uses a private IP address (192.168.x.x:20002/graphql) for the endpoint. So restarting the PC will…
0
votes
0 answers

Post request not getting req.body

I am trying to make a post request with Postman. The only thing that returns is the id made by uuidv4() all the other information for the JSON object is not there. I have tried req.body and req.apiGateway.event.body with no luck. This is my post…
0
votes
1 answer

Cannot invoke a locally running lambda from another locally running application

I have a sails.js backend application and a serverless lambda function. Both are running in the local machine for development purposes, I want to invoke the local running lambda function from the sails.js application, I can use aws-sdk in the sails…
1
2