英文:
Next.js change from edge function to serverless functions on Netlify
问题
在将Next.js项目部署到Netlify时,默认情况下API路由会被部署为边缘函数。我该如何切换以便它们被部署为无服务器函数?
我已经查阅了所有的文档,但找不到关于这个的任何信息。
英文:
When deploying a Next.js project to Netlify, API routes are deployed as Edge Functions by default.
How can I switch so they are deployed as serverless functions?
I've looked through all the docs I can't find anything about this.
答案1
得分: 1
截止到2023年2月,这是不正确的。Next.js API 路由是通过Netlify Functions而不是Netlify Edge Functions部署的。
来源:https://github.com/netlify/next-runtime#generated-functions
引述:
Next.js Runtime通过生成三个Netlify函数来处理尚未预渲染的请求。这些函数是___netlify-handler(用于SSR和API路由)...
英文:
As of February 2023, that is untrue. Next.js API routes are deployed using Netlify Functions and not Netlify Edge Functions.
Source: https://github.com/netlify/next-runtime#generated-functions
Quoting:
> The Next.js Runtime works by generating three Netlify functions that handle requests that haven't been pre-rendered. These are ___netlify-handler (for SSR and API routes)...
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论