Overview
The Next Export API is an essential tool for developers looking to utilize Next.js API Routes on statically exported websites deployed through Netlify. This solution addresses the limitations of using Next.js API Routes in exported projects, making it easier to integrate serverless functions with a streamlined approach. For those who want to leverage the power of Next.js while enjoying the benefits of a static site deployment on Netlify, this tool provides a practical and effective solution.
With a year of inspiration from previous projects like next-on-netlify and next-aws-lambda, the Next Export API focuses specifically on the intricacies of Next.js and its unique export capabilities. This means that it effectively bridges the gap between creating API endpoints in Next.js and deploying them successfully in a serverless environment.
Features
Easy Integration: Seamlessly incorporate Next.js API Routes into statically exported sites on Netlify with straightforward installation steps.
Production Ready: Designed as a production dependency, ensuring it works effectively in real-world deployment scenarios.
Automated File Creation: Automatically generates appropriate files for each API route during the export process, reducing manual setup time.
Redirects Configuration: Creates necessary
_redirectsrules for all API routes, ensuring proper mapping to Netlify’s function calls.Adaptability: Capable of reading page manifests from the Next.js build, enabling customized configurations for different project needs.
Serverless-Compatible: Utilizes well-supported serverless-http for executing Next.js functions, ensuring performance and compatibility with AWS infrastructure.
Easy Setup: The configuration through the
netlify.tomlfile is simple, allowing for quick deployment adjustments as needed.