Socket
Socket
Sign inDemoInstall

@smithc/serverless-offline-lambda-function-urls

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @smithc/serverless-offline-lambda-function-urls

An extension off serverless-offline that adds support to lambda function urls


Version published
Maintainers
1
Created

Readme

Source

Serverless Offline - Lambda Function Urls

Description

This plugin provides a temporal solution to the issue described here.

Setup

  1. Inside your project's serverless.yml file, add the following entry in the plugins section.
plugins:
  - serverless-offline
  - serverless-offline-lambda-function-urls
  1. Configure the port where the new server will be running. By default, the server will run on 3003.
serverless-offline:
  urlLambdaFunctionsHttpPort: 3003

  # Optional - choose which HTTP verb(s) to enable. If omitted, GET and POST will be enabled
  urlLambdaFunctionsHttpVerbs:
    - GET
    - DELETE
  1. Configure a lambda url function. When you add the url option, the handler will expose it as an HTTP endpoint(/dev/ping) with the verbs specified in urlLambdaFunctionsHttpVerbs or GET and POST if that setting is not specified. The HTTP endpoint doesn't go through the API Gateway, which means that you can set your own timeout and it will respect it. Traditionally, the API Gateway would timeout after 30 seconds.
ping:
  handler: ./src/functions/ping.handler
  url: true
  timeout: 120 # The handler will timeout after 2 minutes and API Gateway won't interrupt it
  1. Run serverless offline and the plugin will be triggerred by the offline:start:init event.
serverless offline start

Keywords

FAQs

Last updated on 17 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc