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

@beyond-acres/next-aws-lambda

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beyond-acres/next-aws-lambda

Deploy your NextJS with plain old lambdas. No Lambda at the end. No S3 bucket.

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

next-aws-lamba

Zero dependency AWS Lambda handler for your NextJS project. No need for S3 buckets or Lambda@Edge. Just one simple AWS Lambda.

Example

// lambda.js
const next = require('next')
const lambda = require('next-aws-lambda')

// If you run in dev, set timeout over 10 seconds and memory over 1024mb
// otherwise `sam local start-api` will time out
const dev = process.env.NODE_ENV !== 'production'
const app = next({ dev })

exports.handler = lambda(app, __dirname)

import * as cdk from '@aws-cdk/core';
import * as lambda from '@aws-cdk/aws-lambda';
import { CloudFrontToApiGatewayToLambda } from '@aws-solutions-constructs/aws-cloudfront-apigateway-lambda';

export class Stack extends cdk.Stack {
  constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    new CloudFrontToApiGatewayToLambda(this, 'nextjs-site', {
      lambdaFunctionProps: {
        code: lambda.Code.fromAsset(`${__dirname}`),
        handler: 'lambda.handler',
        memorySize: 1024, // setup above 1024 if running in dev
        runtime: lambda.Runtime.NODEJS_14_X,
        timeout: cdk.Duration.seconds(10), // set to above 10 if running in dev
      }
    })
  }
}

Keywords

FAQs

Package last updated on 12 Mar 2021

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