serverless-next.js  by serverless-nextjs

Serverless component for Next.js deployment to AWS Lambda@Edge

created 6 years ago
4,481 stars

Top 11.1% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a Serverless Component for deploying Next.js applications on AWS Lambda@Edge, targeting developers who want to leverage AWS's global edge network for low-latency server-side rendering and API routes. It aims to offer full feature parity with Next.js, simplifying serverless deployments without CloudFormation resource limits.

How It Works

The component deploys Next.js applications by leveraging AWS Lambda@Edge functions integrated with CloudFront. It intelligently routes requests: static assets and pre-rendered pages are served from S3, while server-side rendered pages and API routes are handled by Lambda@Edge functions, minimizing latency by executing at edge locations. This approach avoids CloudFormation's resource limits, enabling faster deployments for applications with many pages.

Quick Start & Requirements

  • Install via serverless.yml by adding component: "@sls-next/serverless-component@{version_here}".
  • Requires Node.js 12+ and AWS credentials configured as environment variables.
  • Deployment is initiated with the serverless command.
  • See Getting started for detailed instructions.

Highlighted Details

  • Supports server-side rendering (SSR) and API routes at the edge.
  • Handles dynamic pages, catch-all routes, automatic prerendering, and Incremental Static Regeneration (ISR) with SQS integration.
  • Offers extensive customization for CloudFront configurations, including caching, custom origins, error pages, and WAF integration.
  • Provides options for custom domain names with automatic SSL certificate generation via Route53.

Maintenance & Community

This project is no longer actively maintained. The original author cited lack of time and complexity. Users are directed to alternatives like OpenNext and SST. The project has a single core maintainer and community contributors.

Licensing & Compatibility

The project is licensed under the MIT License. It is designed for AWS and Next.js.

Limitations & Caveats

The project is explicitly stated as no longer maintained, meaning no further updates or bug fixes are expected. It may not support newer Next.js features (e.g., Next.js 12 features like middleware are not supported). Users are strongly advised to migrate to modern alternatives.

Health Check
Last commit

6 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
4 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.