Velo Function HTTP Endpoint not working

Question:
As per instructions I created and published a Velo backend function to handle a GET request. I ran the code in the editor and it worked. After publishing the website the following URLs didn’t work.

In the backend editor I did not see Exposing an API button. Why is that?

So I could not do the following:

  1. Click on the Exposing an API button.
  2. Select the function you want to expose and click on the Create Endpoint button.
  3. The endpoint URL will be displayed in the Endpoint URL field.

I tried the URL:
https://www.wallmirror.com/_functions/get_helloworld
following this pattern:
https://www.{user_domain}/_functions/

Product:
Velo Backend Functions

Here’s the code:

import {ok, notFound, serverError} from ‘wix-http-functions’;

export function get_helloworld() {
let options = {
“headers”: {
“Content-Type”: “application/json”
},
“statusCode”: 200,
“body”: {}
};

options.body = {
“message”: “Hello, World!”
};

return ok(options);
}

Hey @Ross_Tiktin!

I guess you’re using the Wix Editor. If so, it’ll be found in the Public & Backend code section. You’ll need to create a new Backend file.

Screenshot 2023-11-28 at 11.03.22

Thanks for getting back to me. I got it working.