I’m writing an extension to add some vendor-specific capabilities to my site, and I’m running up against a rather strange error. I added a http-functions.js and even the pre-generated contents are throwing the following error:
For http-functions they’re not imported but rather called via HTTP GET / POST requests as they’re a way to expose a REST API on your site. They’re only used if there’s a need to consume a site’s functionality off-site.
The exposed endpoints are defined with the naming convention mentioned here:
I used the pre-generated contents without further modification, but it was still throwing the same error when I tried to call the function via its URL at /_functions-dev/multiply or /_functions/multiply.
However, your comment that these are supposed to be used when “exposing functionality to third parties” does tell me that this is not the path I need to take. So thanks for clearing that up!
That said, after some more thought, I don’t quite understand why the Wix infrastructure responds with a 404 when it’s not a question of the resource not existing, but one of an error being thrown while attempting to serve the resource, which would probably be a status in the 5XX range…