This guide explains how to migrate HTTP functions to HTTP endpoints in your new Wix CLI project, as part of migrating an app from the legacy Wix CLI. The main changes involve updating your file structure and syntax.
To migrate your HTTP functions to HTTP endpoints, first update your backend code:
From your legacy project, copy src/backend/api/<name>/api.ts to src/pages/api/<name>.ts in your new Wix CLI project.
Add the APIRoute type import:
Change method signatures from:
To:
After updating your backend code, update your frontend code to call the new endpoints:
Change from:
To:
This example shows the old HTTP functions syntax from your legacy project, with files located in the src/backend/api/ directory.
This example shows the new HTTP endpoints syntax in your new Wix CLI project, with files located in the src/pages/api/ directory.
Last updated: 29 June 2026