Calling django backend api through NextJS server components
Unanswered
Masai Lion posted this in #help-forum
Masai LionOP
I am trying to call a django endpoint with a fetch request. It works fine when I call it from a server component but when I use a client component I get an error that looks like
[cause]: Error: connect ECONNREFUSED 127.0.0.1:443
2024-07-20T05:16:14.881029210Z at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1606:16)
2024-07-20T05:16:14.881030752Z at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
2024-07-20T05:16:14.881032127Z errno: -111,
2024-07-20T05:16:14.881034543Z code: 'ECONNREFUSED',
2024-07-20T05:16:14.881038210Z syscall: 'connect',
2024-07-20T05:16:14.881039585Z address: '127.0.0.1',
2024-07-20T05:16:14.881040918Z port: 443
2024-07-20T05:16:14.881042502Z }
2024-07-20T05:16:14.881043918Z }