Http-functions.js

**Hi everybody

I’m having trouble with http-functions**
Working in Wix Editor, Dev Mode

I’ve created in my backend a http-function.js file which includes the following :

// backend/http-functions.js

import wixData from ‘wix-data’;

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

export function get_getImages(request) {

console.log(“getImages called”);

return ok({

items: [

{

schema: “example.png”,

nom: “Exemple”,

}

]

});

}

When i test it with hoppscotch, i get an empty response in json
URL tested looks like the following :

https://username.wixsite.com/site-name/_functions/getImages

Any clue, why this doesn’t work ?

Thanks a lot for your support

According to documentation

The object you pass as argument to ok() should be of the following type:
{ body: any, headers: Headers }

Try this:

return ok({
  body: {
    items: [{ 
      schedule: 'example.png',
      nom: 'example'
    }]
  }
})

Thank you very much Dean