# Step 2: Download and run the sample code

In this step, you will download and run the sample code provided with the tutorial. The sample code requires Node.js to be installed on the local environment.

## Procedure

1. Execute the following command to download the [sample code](https://sf3-cn.feishucdn.com/obj/open-platform-opendoc/68fae2a0c02f0d6683fd3ca7476c37ca_jniC7YMODS.zip) locally.

```bash
    curl https://sf3-cn.feishucdn.com/obj/open-platform-opendoc/68fae2a0c02f0d6683fd3ca7476c37ca_jniC7YMODS.zip -o web_app_quick_start.zip
    ```

2. Unzip the sample code (web_app_quick_start.zip).

3. In the directory where the sample code is located, execute the following command to enter the `/web-app` directory and install the dependency package.

```bash
     cd web-app/
     npm install
     ```

4. Edit the `config.js` file.

- On macOS/Linux, execute the following command.

```bash
  vim /src/config.js
  ```
If you are not familiar with the method of editing files on the command line, you can use a local editor to open the `/src/config.js` file in the sample code for editing.

- On Windows, use a local editor to open the `/src/config.js` file.

5. Change the appId and appSecret parameter values in the file to the actual app credential values.

On macOS/Linux, you need to press `i` to enter the edit mode.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/814a7ca674f44d5681e0e031db843ad6_qXztCYQ8Ss.png?height=196&lazyload=true&maxWidth=500&width=944)

How to obtain App ID and App Secret:

1. Log in to [Developer Console](https://open.feishu.cn/app).

2. Enter the app details page, and click **Credentials & Basic Info** on the left navigation bar.

3. In the **Credentials** area, obtain and save the **App ID** and **App Secret**.

![image.png](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/21852f77e0d9c65cf10b015e6cbd6458_KMoV3ANztq.png?height=358&lazyload=true&maxWidth=600&width=2368)

6. When the modification is complete, save and exit the file.

On macOS/Linux, you need to press `esc` to exit the editing mode, and enter `:wq` and then press Enter to save and exit the file.

7. Run the following command in the `/web-app/` directory to start the service.

```
     npm run start
     ```

After the service is successfully started, the information displayed on the command line is shown in the figure below.

![](//sf3-cn.feishucdn.com/obj/open-platform-opendoc/f816cbac3c89e713dc1c8c990cbf4f02_ymCmGGhUwu.png?height=628&lazyload=true&maxWidth=500&width=1198)