Exposing API - get_function(request) path is undefined

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!

If still not resolved —> the following post could help you…

Hi, I’ve checked this but still didn’t get any help. If you can check my code, Is there any error? “myrequest” console showing URL but “myrequest.path[0]” showing error that can’t read the property of 0 undefined.