Unhandled Runtime Error: fetch failed
Unanswered
Bumble bee posted this in #help-forum
Bumble beeOP
This is my code:
I get the response:
I am quite helpless... 😦
import City from '@/types/city'
export default async function CitiesList() {
const cities = await (
await fetch('http://localhost:8000/api/cities', {
method: 'GET'
})
).json()
return (
<>
{cities.map((city: City) => (
<>{city.name}</>
))}
</>
)
}I get the response:
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 8000I am quite helpless... 😦