Getting database data in backend?

Hi,

I’m trying to get database value in my backend which is used to get the result in front end using the repeater.

My code is working when I’m using const, below is the code so you will understand what I want to achieve -

Full Example I’m trying to code in backend to call in frontend using repeater

import { fetch } from 'wix-fetch';
import wixData from 'wix-data';
 
export async function getData() {

const apiKey = "apikey";
let id = await wixData.get('#myDatabaseName', 'title'); //Here i want to take values from my database.

//imaginary url example below
 const response = await fetch("https://www.exampleapi.com/data/d5/feed?&id=" + id.title + "&key=" + apiKey, {
        method: 'get'
    });
    

#database #backend #repeater #corvid

Any Idea? @Yisrael (Wix) @givemeawhisky What I’m doing wrong here, please suggest me