React/Next.js

Next.js doesn't call the local Rust API

brightlightkim 2022. 11. 26. 04:43

If the public api call is something containing "localhost," it's better to use "0.0.0.0" instead.

 

NEXT_PUBLIC_API_URL = 'http://localhost:8080'

If it's like this and doesn't work, try:

NEXT_PUBLIC_API_URL = 'http://0.0.0.0:8080'