Return external data in ctx.send from custom controller

Thank @Gayrat I did try that, I have an issue then though accessing the ctx within the promise scope, see the below revised code which gives ‘Not Found’ when I hit the endpoint.

I can console.log the results of the promise but cant send it back as a response.

module.exports = {

    async index(ctx) {

        const tourId = ctx.params.id;

         let tour = new Promise((resolve, reject)=> {
            TourCMS.showTour({
                channelId: channelId,
                tourId: tourId,
                callback: (response) => {
                    //console.log('response', response);
                    resolve(response)
                }
            });
         })

        tour.then(response => {
            console.log(response)
            ctx.send(response)
        })
                     
    }
};