http-functions doesn't run. Even use the same code in different site.

I have two website using the same code in http-functions but one can use fluently but another always return 404 even I use the exact same code in that function.

Here’s the one on site A.

‘use strict’ ;
import wixData from ‘wix-data’ ;
import { ok , response , notFound , serverError , created } from ‘wix-http-functions’ ;

export function post_customer ( request ) {
let options = {
“headers” : {
“Content-Type” : “application/json”
}
};
// get the request body
return request . body . json ()
. then (( body ) => {
let customergeo = {

            "customerid" :  body . customerid . toString (), 
            "customername" :  body . customername 

        } 

        **return**  wixData . insert ( "cloudcafe" ,  customergeo ); 
    }) 
    . then (( results ) => { 
        options . body  = { 
            "inserted" :  results 
        }; 
        **return**  created ( options ); 
    }) 
    // something went wrong 
    . **catch** (( error ) => { 
        options . body  = { 
            "error" :  error 
        }; 
        **return**  serverError ( options ); 
    }); 

}


This always return 201 :grinning:


Here’s the one on siteB

‘use strict’ ;
import wixData from ‘wix-data’ ;
import { ok , response , notFound , serverError , created } from ‘wix-http-functions’ ;
export function post_customer ( request ) {
let options = {
“headers” : {
“Content-Type” : “application/json”
}
};
// get the request body
return request . body . json ()
. then (( body ) => {
let customergeo = {

            "customerid" :  body . customerid . toString (), 
            "customername" :  body . customername 

        } 

        **return**  wixData . insert ( "cloudcafe" ,  customergeo ); 
    }) 
    . then (( results ) => { 
        options . body  = { 
            "inserted" :  results 
        }; 
        **return**  created ( options ); 
    }) 
    // something went wrong 
    . **catch** (( error ) => { 
        options . body  = { 
            "error" :  error 
        }; 
        **return**  serverError ( options ); 
    }); 

}

And It always return 404 :persevere:


Anyone has some solutions please help. Thank you for advance. :heart_eyes:

Did you save and publish Site B after adding the http functions?

Is the request “body” the same for both examples?

If you suspect that this is a bug, contact Wix Customer Care as they will be able to evaluate and escalate if needed.

Thank you Yisrael.