summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-management.md15
-rw-r--r--storefront/pages/_app.js4
2 files changed, 18 insertions, 1 deletions
diff --git a/app-management.md b/app-management.md
index 1f9f326..8fcb3db 100644
--- a/app-management.md
+++ b/app-management.md
@@ -124,6 +124,21 @@ curl -i -H "Origin: http://192.168.99.22:8000" http://192.168.99.22:9000/store/p
- `http://192.168.99.22:9000/store/products` : endpoint backend teste.
- Attendu : `Access-Control-Allow-Origin: http://192.168.99.22:8000`.
+Retour attendu (exemple) :
+```
+HTTP/1.1 200 OK
+Access-Control-Allow-Origin: http://192.168.99.22:8000
+Vary: Origin
+Access-Control-Allow-Credentials: true
+Content-Type: application/json; charset=utf-8
+```
+
+- `HTTP/1.1 200 OK` : le backend repond sans erreur.
+- `Access-Control-Allow-Origin` : l'origine autorisee (doit matcher le storefront).
+- `Vary: Origin` : la reponse depend de l'origine envoyee.
+- `Access-Control-Allow-Credentials` : autorise cookies/credentials.
+- `Content-Type` : format de la reponse (JSON attendu).
+
### D) Verifier la base (depuis un conteneur temporaire)
```
diff --git a/storefront/pages/_app.js b/storefront/pages/_app.js
index 1424c52..3737ae7 100644
--- a/storefront/pages/_app.js
+++ b/storefront/pages/_app.js
@@ -8,7 +8,9 @@ export default function App({ Component, pageProps }) {
return (
<MedusaProvider
queryClientProviderProps={{ client: queryClient }}
- baseUrl="http://localhost:9000"
+ baseUrl={
+ process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL || "http://localhost:9000"
+ }
>
<Component {...pageProps} />
</MedusaProvider>