Skip to content

Commit

Permalink
fix: avoid hardcoding localhost in strapi adaptor
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvxd committed Jul 6, 2023
1 parent 69ee221 commit f8d920c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/adaptor-strapi/index.ts
Original file line number Diff line number Diff line change
@@ -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<AdaptorParams> = {
name: "Strapi.js",
Expand All @@ -10,7 +10,7 @@ const strapiAdaptor: Adaptor<AdaptorParams> = {
}

const res = await fetch(
`http://localhost:1337/api/${adaptorParams.resource}`,
`${adaptorParams.url}/api/${adaptorParams.resource}`,
{
headers: {
Authorization: `bearer ${adaptorParams.apiToken}`,
Expand Down

0 comments on commit f8d920c

Please sign in to comment.