Quantcast
Channel: Lucee Dev - Latest topics
Viewing all articles
Browse latest Browse all 523

REST API can't find datasurce "attribute [datasource] is required when attribute [dbtype] is not [query] and no default datasource is defined" lucee

$
0
0
"attribute [datasource] is required when attribute [dbtype] is not [query] and no default datasource is defined" lucee
function onApplicationStart() {
    restInitApplication(
            dirPath=ExpandPath( "." ), 
            serviceMapping="vodovod", 
            password="changeit"
    );

    return true;
}

It can’t find my datasource which is defined as the default one, however when I move all my rest .cfc files to the root folder and redifine my rest api as follows:

function onApplicationStart() {
    restInitApplication(
            dirPath=ExpandPath( "." ), 
            serviceMapping="vodovod", 
            password="changeit"
    );

    return true;
}

I am able to query data from the datasource.
Coincidentally when I create a sub folder and put a normal cfm file in it and just query data casually it works without problem and without a need to specify a datasource. Btw i tried both specifying the datasource explicitly and not at all and neither worked. Why isn’t the rest subfolder able to detect the datasource?

I run Lucee in a docker container.

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 523

Trending Articles