deploy stuff, envs
This commit is contained in:
@@ -18,7 +18,6 @@ const BASE_URL = getStrapiBaseUrl();
|
||||
<div {...otherProps}>
|
||||
{
|
||||
elements.map((poleElement) => (
|
||||
console.log(poleElement),
|
||||
<a href={`/elements/${poleElement.id}`} class="block">
|
||||
<article class="flex items-center bg-white rounded-lg shadow-lg overflow-hidden hover:shadow-xl transition-shadow duration-200">
|
||||
<img
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Global Strapi configuration
|
||||
export const STRAPI_CONFIG = {
|
||||
BASE_URL: (import.meta.env.STRAPI_URL as string) || "http://localhost:1337",
|
||||
BASE_URL: (import.meta.env.STRAPI_URL as string) || (process.env.STRAPI_URL as string) || "http://localhost:1337",
|
||||
} as const;
|
||||
|
||||
// Helper function to get the base URL
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
// Global Strapi configuration
|
||||
export const STRAPI_CONFIG = {
|
||||
BASE_URL: (import.meta.env.STRAPI_URL as string) || (process.env.STRAPI_URL as string) || "http://localhost:1337",
|
||||
} as const;
|
||||
|
||||
// Helper function to get the base URL
|
||||
export function getStrapiBaseUrl(): string {
|
||||
return STRAPI_CONFIG.BASE_URL;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
endpoint: string;
|
||||
query?: Record<string, string>;
|
||||
@@ -22,8 +32,7 @@ interface Props {
|
||||
if (endpoint.startsWith('/')) {
|
||||
endpoint = endpoint.slice(1);
|
||||
}
|
||||
const strapiUrl = import.meta.env.STRAPI_URL || process.env.STRAPI_URL || "http://localhost:1337";
|
||||
console.log(strapiUrl);
|
||||
const strapiUrl = getStrapiBaseUrl();
|
||||
const url = new URL(`${strapiUrl}/api/${endpoint}`);
|
||||
|
||||
if (query) {
|
||||
|
||||
Reference in New Issue
Block a user