Greetings.
I am trying to get a value of a function result. I have one website that has a database and the other that I need to have the value obtained from the first website database displayed using HTTPS function. The http request seems not to work. The error am getting is a 404 error. I will also appreciate clues on how to display the text in my second site as a value. Here is my code:
//https://erickkipngeno12.wixsite.com/mysite-2/_functions/myFunctions/john
import { ok, notFound, serverError } from ‘wix-http-functions’ ;
import wixData from ‘wix-data’ ;
export function get_myFunction(request) {
let options = {
“suppressAuth” : true ,
“suppressHooks” : true
}
return wixData.query( “sample” )
.eq( "number1" , request.path[ 0 ])
.find()
.then((results) => {
if (results.items.length > 0 ) {
const body = “Found it!” ;
return ok({ body: body });
}
const body = “Not in the system” ;
return notFound({ body: body });
});
}
Any help will be appreciated!