Implementing Serverless mode excellently improves scalability and readability of an application by splitting it into smaller parts known as lambdas. It also promotes affordability with a "pay for what you use" model.

To enable Serverless mode in Next JS, we have to add ‘serverless’ build target in next.config.js.

BY Best Interview Question ON 08 Jun 2019

Example

// next.config.js

module.exports = {

target: 'serverless'

}