You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Vercel上设置Express的最大执行时长

调整Vercel上Express.js API的最大执行时长

作为Vercel Pro计划用户,你可以通过修改vercel.json配置文件,给Node.js函数设置最大60秒的执行时长,具体操作如下:

在你现有的builds配置项中,为@vercel/node添加config字段并指定maxDuration参数:

{
  "version": 2,
  "builds": [
    {
      "src": "index.js",
      "use": "@vercel/node",
      "config": {
        "maxDuration": 60
      }
    }
  ],
  "routes": [
    {
      "src": "/(.*)",
      "dest": "/"
    }
  ]
}
  • maxDuration的单位是秒,Pro计划允许的最大值为60,免费计划仅支持最多10秒
  • 修改配置后,需要重新部署项目,新的执行时长限制才会生效

内容的提问来源于stack exchange,提问作者Orest Stryhunov

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.23 21:22:01