Questions tagged [serverless-offline]

Serverless Offline plugin for the Serverless Framework – Emulates AWS Lambda and API Gateway locally when developing your Serverless project

Serverless Offline plugin emulates AWS λ and API Gateway on your local machine to speed up your development cycles. To do so, it starts an HTTP server that handles the request's lifecycle like APIG does and invokes your handlers.

112 questions
1
vote
0 answers

Debugging lambda golang locally in API mode with serveless-framework

with SAM I am able to run the API and Debug with VS Code or GoLand while using Postman for example. sam local start-api -d 8997 --debugger-path ./scripts/linux --region us-east-1 While using serverless I found this way for debugging: docker run…
1
vote
1 answer

How to reference handlers in sub-directories in serverless-offline?

Windows 10 64bits Node v12.16.3 Serverless 1.71.3 serverless-offline 6.1.7 DIRECTORY: root: - package.json - /sub -- __init__.py -- sub_handler.py - ... - handler.py - serverless.yml Hi, I'm currently trying to test locally two lambda functions…
1
vote
1 answer

Serverless azure offline: value cannot be null. (Parameter 'provider')

I'm experimenting for the first time with serverless functions. More specifically am I writing a nodejs12 function that I want to deploy on the azure cloud. I'm using serverless for this. When trying to run the default generated functions locally…
JC97
  • 1,530
  • 2
  • 23
  • 44
1
vote
0 answers

Unable to get NodeJS Routes when executing lambda functions locally getting Page not found response

I am currently working on a Node.JS application deployed as an AWS Lambda function. When I try to access the routes locally it responds with page not found. I have different config files for different functions listed. Some are public routes and…
Amit
  • 193
  • 1
  • 8
1
vote
1 answer

Why does serverless-offline re-execute my whole js file for a handler?

I'm running a apollo-server-lambda locally in using serverless-offline. Even though the handler is being exported once, the serverless-offline code is fully recreating the ApolloServer for every request (which is causing my knex to create new DB…
Dan Hill
  • 143
  • 1
  • 1
  • 6
1
vote
1 answer

Running lambdas locally using separate serverless-offline packages OR AWS SAM Local OR Moto library

I need to create an integration project which when executed, it should start all aws mock services such as S3, API gateway, SQS, Dynamo db and SSM. We used serverless.com framework for developing lambdas in Node.js that use the above AWS services…
1
vote
1 answer

serverless offline exec does return exit code

I am running the following code in a ci/cd pipeline: sls offline start --showDuration --exec "npm run int-test" However, when a test fails, the ci/cd pipeline does not fail because the failure of a test is not trickling down to the script, which is…
ed4becky
  • 1,488
  • 1
  • 17
  • 54
1
vote
1 answer

Nodejs Serverless Docker Image

I am trying to setup a docker image for my local serverless development and I'm having issues reaching the files using volumes. Dockerfile FROM node:8.10 ADD . /code WORKDIR /code RUN npm install -g serverless RUN npm install…
1
vote
1 answer

Serverless-offline does not recognize graphql handler as a function

I'm trying to convert my serverless nodejs graphql api to use typescript but serverless throws an error stating that the graphql handler is not a function. Error message: Error: Serverless-offline: handler for 'hello' is not a function at…
Peter Savnik
  • 763
  • 1
  • 8
  • 27
1
vote
1 answer

Connection refused from serverless-offline lambda to host database

This question is related to serverless-offline plugin, local mysql database connection. The scenarios for my test is as follows. Using serverless-offline plugin, a lambda function is deployed locally on my machine. The triggered lambda is not…
1
vote
1 answer

No response from any API routes when using Serverless-offline plugin

from mangum import Mangum from fastapi import FastAPI app = FastAPI() @app.post("/items/") def create_item(item_id: int): return {"id": item_id} @app.get("/items/") def list_items(): items = [{"id": i} for i in range(10)] return…
Anil Kumar
  • 459
  • 6
  • 16
1
vote
1 answer

Serverless interlambda local communication

I have a serverless project with 3 "layers" - api, services and db. Each layer is just a set of function deployed individually (I have setting package.individually === true in .serverless.yml). All layers able to communicate using invocation…
Alex G.P.
  • 9,609
  • 6
  • 46
  • 81
1
vote
1 answer

How to send lambda's offline traces to a local xray daemon with serverless offline?

I can locally execute the lambda with serverless offline, I've set AWS_DAEMON_ADRESS to '127.0.0.1:2000' in the .env file, but the running daemon listening to this port do not receive any data from the execution. The trouble is that the same code…
1
vote
0 answers

Multiple ORIGINS for CORS not working in case of custom authorizer error

I have CORS enabled in the application and have multiple origins, Its working fine with normal requests and error responses. But when I am getting some error in custom authorizer or deny the authorization. The CORS is not working for any status…
0
votes
0 answers

Serverless Offline - Attempt to invoke function 'xxx' failed. Function does not exists

Hello :) Hope to find you well. I am trying to set test my serverless environment locally via the serverless-offline node package. Here is my serverless.yml file: org: etisreal11 app: leaderboards-api service: leaderboards-api provider: name:…