Hi, I’m trying to expose my website API but while making request by someone I’m unable to get the path value . It’s showing “undefined”.
Also, when I use the keyword “myrequest” as an argument I’m getting message that function is called with “undefined”. Is the keyword “request” is default argument which should be passed inside the function?
import {serverError, ok, notFound} from 'wix-http-functions';
export function get_myFunction(myrequest) {
// URL: - Base_URL/allcontacts/_owner
// Base_URL/_functions/myFunction/allcontacts/234
console.log(myrequest.path[0]);
console.log(myrequest.path[1]);
let options = {
"headers": { "Content-Type": "application/json", }
};
}
I also need conceptual help with the API i.e.
For exposing an API, is this necessary to use webModule.jsw file?
Can we call http-function.js function from the front_end?
Thanks in Advance!