connect ECONNREFUSED 127.0.0.1:80 #13316
-
| In my  I get connect ECONNREFUSED 127.0.0.1:80. If I put the data fetching on the client side, it works. But I'd like to reder the data on the server side. How to I get the SSR to work? | 
Beta Was this translation helpful? Give feedback.
Replies: 2 suggested answers 5 replies
-
| Next recommends you write your server code directly in  Otherwise you'd have to put the fully qualified url in your  | 
Beta Was this translation helpful? Give feedback.
-
| I had the same error because of a typo, a  | 
Beta Was this translation helpful? Give feedback.
Next recommends you write your server code directly in
getServerSideProps: https://nextjs.org/docs/basic-features/data-fetching#write-server-side-code-directlyOtherwise you'd have to put the fully qualified url in your
axios.get(`https://my-domain.com/api/trends...`)because the server doesn't know what your domain is.