ECONNRESET/ ECONNREFUSED while calling backend via REST Api in Shopify App

Hey,

I followed this example on building a shopify app with the 3.0 CLI. However when I try to fetch data from the backend via a REST API I get an error saying either ECONNREFUSED or ECONNRESET.

I tried both fetching the data with useAppQuery and

useAuthenticatedFetch - as done in the example mentioned above.

Thats the code I use to query the data:

const {
    data: data2,
} = useAppQuery({
    url: "/api/overview2",
});

Here is the API endpoint I am trying to call:

app.post("/api/overview2", async(req, res) => {
    console.log("func called")
    res.status(201).send("test")
})

The console.log inside the API call does not get called, changing the request type to a get request did not work either.

Any help is greatly appreciated :slightly_smiling_face:

Thanks!

1 Like

I’m facing the same issue, any solution for this?

1 Like

Same here