> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Deprecated: Call Backend Code from the Frontend ## Article: Deprecated: Call Backend Code from the Frontend ## Article Link: https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/web-modules/deprecated-call-backend-code-from-the-frontend.md ## Article Content: # Deprecated: Call Backend Code from the Frontend [Web modules](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/web-modules/about-web-modules.md) allow you to write backend functions that you can easily call from the frontend.
**Warning:** Web modules defined using `.jsw` files are deprecated and you will soon be unable to create new `.jsw` files. However, existing `.jsw` web modules will continue work as expected. Switch to [web module defined using `.web.js` files](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/web-modules/call-backend-code-from-the-frontend.md) for your current and future projects.The following describes how to create, export, and call web module functions. ## Step 1 | Define a function in the backend Add an exported function to an existing `.jsw` file. ```js export function myFunction(someParam) { // Some functionality to call from the frontend return `You passed me ${someParam}`; } ``` ## Step 2 | Set permissions Set [permissions](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/web-modules/about-web-modules.md#permissions) for each function in the web module if necessary. Permissions can only be added and updated in the editor's UI. The default permission is **Anyone**. To set permissions for a web module function: 1. Hover over your web module, click the more actions menu, and select **Edit Web Module Permissions**. The web module permissions panel opens and displays each exported function in your web module. 2. Click the dropdown next to a function name to define its permissions. ## Step 3 | Call the function in the frontend To call a web method from the frontend: 1. Import the exported web method from the web module you created above: ```javascript import { myFunction } from "backend/weather.jsw"; ``` 2. Call the imported function: ```js const fromBackend = await myFunction(someValue); ``` Remember, web module functions are always asynchronous. ## See also - [About web modules](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/web-modules/about-web-modules.md) - [Call backend code from the frontend](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/build-a-custom-backend/web-modules/call-backend-code-from-the-frontend.md)