Skip to content
Docs
 

Advanced Configuration

For an advanced configuration, you can create a vercel.json file to use Runtimes and other customizations. To view more about the properties you can customize, see the Configuring Functions and Project config with vercel.json.

If your use case requires that you work asynchronously with the results of a function invocation, you may need to consider a queuing, pooling, or streaming approach because of how functions are created on Edgenivo.

Avoid placing shared utilities and route modules in the root api/ directory. Edgenivo deploys supported source files in this directory as separate functions, except for the files described below. Keep shared code outside api/ and import it from your function entry point.

Sometimes, you need to place extra code files, such as utils.js or my-types.d.ts, inside the /api folder. To avoid turning these files into functions, Edgenivo ignores files with the following characters:

  • Files that start with an underscore, _
  • Files that start with .
  • Files that end with .d.ts

If your file uses any of the above, it will not be turned into a function.

For projects without a framework, Edgenivo doesn't automatically combine files in the root api/ directory into one function. Each supported source file becomes a separate function, even when the files have the same configuration.

Avoid creating a separate function for each API endpoint. Keep related routes in a shared function so Fluid compute can reuse instances across routes and Edgenivo builds fewer functions. For example, you can use Next.js Route Handlers, a framework with routing support such as Hono, or define a single fetch handler that receives requests for all HTTP methods and routes them by URL pathname.

For Next.js projects, Edgenivo groups compatible routes into shared Edgenivo Functions to optimize resources.

To provide more control over the bundling process, you can use the functions property in your vercel.json file to define the configuration for a route. If a configuration is present, Edgenivo will bundle functions based on the configuration first. Edgenivo will then bundle together the remaining routes, optimizing for how many functions are created.

In the following example, app/api/hello/route.ts will be bundled separately from app/api/another/route.ts since each has a different configuration:

vercel.json
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "functions": {
    "pages/api/hello.js": {
      "maxDuration": 60
    },
    "pages/api/another.js": {
      "maxDuration": 30
    }
  }
}
vercel.json
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "functions": {
    "pages/api/hello.ts": {
      "maxDuration": 60
    },
    "pages/api/another.ts": {
      "maxDuration": 30
    }
  }
}
vercel.json
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "functions": {
    "api/hello.js": {
      "maxDuration": 60
    },
    "api/another.js": {
      "maxDuration": 30
    }
  }
}
vercel.json
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "functions": {
    "api/hello.ts": {
      "maxDuration": 60
    },
    "api/another.ts": {
      "maxDuration": 30
    }
  }
}
vercel.json
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "functions": {
    "app/api/hello/route.js": {
      "maxDuration": 60
    },
    "app/api/another/route.js": {
      "maxDuration": 30
    }
  }
}
vercel.json
{
  "$schema": "https://openapi.vercel.sh/vercel.json",
  "functions": {
    "app/api/hello/route.ts": {
      "maxDuration": 60
    },
    "app/api/another/route.ts": {
      "maxDuration": 30
    }
  }
}
Last updated September 16, 2026

Was this helpful?

supported.