Question: I tried to get some answers here on stack overflow but I don't really understand it.

I want to execute my node js script by clicking on a button in html.
The node js file pulls data from an excel sheet and puts it into a specific sheet.

The node js file works perfectly if I run it in the console. But how do I connect this file with a button in html? It is not possible just to call the function, because the node js file is running on a server.

**This is the function I want to execute by clicking on a button**

```
function importData(){
    //import the smartsheet
    ss.sheets.importXlsxSheet(options)
    .then(function(result) {
        console.log("Created sheet '" + result.result.id + "' from excel file");

        // Load entire sheet
        ss.sheets.getSheet({ id: result.result.id })
            .then(function(sourceSheet) {
                console.log("Loaded: " + sourceSheet.rows.length + " rows from sheet '" + sourceSheet.name + "'");
                console.log("Done");

                    //copy every row from sourcesheet in a array 
                    const sourceSheetRows = sourceSheet.rows;
                    writeRowsinArray(result, sourceSheetRows);
            })
            .catch(function(error) {
                console.log(error);
            });
    })
    .catch(function(error) {
        console.log(error);
    });
}

```

Answer: 
The standard way to trigger something on a server from a browser is to make an HTTP request to it.

So set up an HTTP endpoint that will trigger the function (e.g. by running a server built around the express module or using a cloud service such as AWS Lambda) then use client-side JS to make the request (e.g. with the Fetch API).
You have to call an exposed api for that.
Your nodeJs script have to listen on an endpoint.

From JavaScript in your html you have to call your api using [fetch](https://developer.mozilla.org/fr/docs/Web/API/Fetch_API/Using_Fetch).