Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

serverless-offline

Package Overview
Dependencies
Maintainers
0
Versions
407
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project

  • 13.9.0
  • legacy
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
369K
increased by60.94%
Maintainers
0
Weekly downloads
 
Created

What is serverless-offline?

The serverless-offline npm package allows you to run a local development environment that simulates AWS Lambda and API Gateway. This enables you to develop and test your serverless applications locally without deploying them to the cloud.

What are serverless-offline's main functionalities?

Simulate AWS Lambda

This feature allows you to simulate AWS Lambda functions locally. The code sample shows how to configure the serverless-offline plugin in your serverless.yml file to run on port 3000.

const serverless = require('serverless-offline');

module.exports = {
  plugins: [serverless],
  custom: {
    'serverless-offline': {
      port: 3000
    }
  }
};

Simulate API Gateway

This feature allows you to simulate API Gateway endpoints locally. The code sample shows how to define a simple HTTP GET endpoint that triggers the 'hello' function.

const serverless = require('serverless-offline');

module.exports = {
  plugins: [serverless],
  functions: {
    hello: {
      handler: 'handler.hello',
      events: [
        {
          http: {
            path: 'hello',
            method: 'get'
          }
        }
      ]
    }
  }
};

Custom Lambda Environment Variables

This feature allows you to set custom environment variables for your Lambda functions. The code sample shows how to define an environment variable 'MY_ENV_VAR' with a value of 'value'.

const serverless = require('serverless-offline');

module.exports = {
  plugins: [serverless],
  provider: {
    environment: {
      MY_ENV_VAR: 'value'
    }
  }
};

Other packages similar to serverless-offline

Keywords

FAQs

Package last updated on 09 Dec 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc