Today I play around with nuxt.js and loopback, and start a simple api server using loopback and use that in nuxt.js.
But when I call the api using proxy devserver config, an error occurred: Error occurred while trying to proxy request / from localhost:4000 to http://localhost:3000 .
First the error seemed confusing, because I just config proxy like usual. But after some googling, found out that the loopback is actually running on ipv6,
Server is running at http://[::1]:3000
Try http://[::1]:3000/ping
and the reason behind the error is the client dev server proxy request to ipv4.
Today I play around with
nuxt.js
andloopback
, and start a simple api server usingloopback
and use that innuxt.js
.But when I call the api using proxy devserver config, an error occurred: Error occurred while trying to proxy request / from localhost:4000 to http://localhost:3000 .
First the error seemed confusing, because I just config proxy like usual. But after some googling, found out that the
loopback
is actually running on ipv6,and the reason behind the error is the client dev server proxy request to ipv4.
So just change this in
nuxt.config.ts
:https://github.com/saikat/react-apollo-starter-kit/issues/20#issuecomment-316651403