You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use http client, visit http://127.0.0.1:8080/index.html :
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width, initial-scale=1.0"><title>Document client 2</title></head><body><script>constfetchAPIPost=async()=>{console.log('fetchAPIPost');constres=awaitfetch('http://127.0.0.1:8081/api/hello',{method: 'POST',mode: 'cors',// If I remove the headers field, the cross-domain works, but with it, it doesn't.headers: {'x1-Content-Type': 'application/json',},body: JSON.stringify({a: 'xx',}),});constresJSON=awaitres.json();console.log('post resJSON=>',resJSON);}fetchAPIPost()</script></body></html>
server, run http://127.0.0.1:8081/api/hello, on modernjs BFF mode:
Version
Details
use http client, visit
http://127.0.0.1:8080/index.html
:server, run
http://127.0.0.1:8081/api/hello
, on modernjs BFF mode:/api/hello
:If I remove the headers field, the cross-domain works, but with it, it doesn't.
Reproduce link
https://modernjs.dev/guides/advanced-features/bff/sdk.html
Reproduce Steps
see detail section.
The text was updated successfully, but these errors were encountered: