title: Call a node.js function inside an html file
body: <p>This is most likely a repeated question.</p>
  
  <p>The closest I got to an answer was here: <a href="https://stackoverflow.com/questions/9670222/execute-a-nodejs-script-from-an-html-page">execute a Nodejs script from an html page?</a></p>
  
  <p>Yet, I still can't understand.</p>
  
  <p>So here's the situation:</p>
  
  <p>I have an express server setup with the following files:</p>
  
  <ul>
  <li>Express App
  
  <blockquote>
    <p>server.js
    index.html</p>
  </blockquote></li>
  </ul>
  
  <p>and right now I want the html folder to have a button, that calls a function set in the node.js file.</p>
  
  <p>Tell me if more information is needed, thanks!</p>
  
  <p>EDIT:
  Im remaking the question to be more clear.</p>
  
  <p>I am using an express server to present a website, that present a button saying " Power Off", I want this button to be able to execute an action on my server computer, that action being a terminal command to power it off.</p>
  
  <p>I wanted to know how could I make said button, written in HTML, hosted on the server but presented to the client, to interact with the server.js file hosted on the server, which would have a function set to execute said command.</p>
  
  <p>thanks!</p>