Add a JavaScript function to render your component

JavaScript is used to handle the server-side rendering of your component.

For your Hello World component we will add a simple output that will display a heading in HTML and have a simple text input.

  1. Edit your main.cjs file

  2. Add the following JavaScript code:

    // MAIN FUNCTION
    module.exports = async function (input, info) {
      return `<h1>Hello World! ${input.text} </h1>`;
    };