From f8d920c6d188e9b8c9ea1bc7cb58d63e6f25d823 Mon Sep 17 00:00:00 2001 From: Chris Villa Date: Thu, 6 Jul 2023 18:12:05 +0100 Subject: [PATCH] fix: avoid hardcoding localhost in strapi adaptor --- packages/adaptor-strapi/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/adaptor-strapi/index.ts b/packages/adaptor-strapi/index.ts index 79b4b83672..76bf621fc7 100644 --- a/packages/adaptor-strapi/index.ts +++ b/packages/adaptor-strapi/index.ts @@ -1,6 +1,6 @@ import { Adaptor } from "@measured/puck/types/Config"; -type AdaptorParams = { apiToken: string; resource: string }; +type AdaptorParams = { apiToken: string; url: string; resource: string }; const strapiAdaptor: Adaptor = { name: "Strapi.js", @@ -10,7 +10,7 @@ const strapiAdaptor: Adaptor = { } const res = await fetch( - `http://localhost:1337/api/${adaptorParams.resource}`, + `${adaptorParams.url}/api/${adaptorParams.resource}`, { headers: { Authorization: `bearer ${adaptorParams.apiToken}`,