API call from client to server #2570
-
Hi there, I'm using the template from API Platform. I've worked on the back end and it works just fine from the doc page or Postman for instance. I've created a next js app in the pwa folder and when I'm trying to access some data, I've got an error. I've tried with fetch and axios, same result. Back : Front :
Error :
If anyone encountered this issue, or could help me, that would be awesome. Thanks ! Laurent |
Beta Was this translation helpful? Give feedback.
Answered by
LaurentSanson
Nov 13, 2023
Replies: 1 comment
-
Resolved it by adding php server name in trusted hosts like :
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
LaurentSanson
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resolved it by adding php server name in trusted hosts like :
TRUSTED_HOSTS: ^${SERVER_NAME:-example\.com|localhost|php}