mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Set base API prefix to origin in production
This commit is contained in:
@@ -146,5 +146,5 @@ export const handleImagePaste = async (event: ClipboardEvent) => {
|
|||||||
return newContent;
|
return newContent;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const API_BASE_PREFIX = dev ? "http://localhost:3000" : "/api";
|
export const API_BASE_PREFIX = dev ? "http://localhost:3000" : `${process.env.ORIGIN}/api`;
|
||||||
export const NGINX_BASE_PREFIX = dev ? "http://localhost:18000" : "";
|
export const NGINX_BASE_PREFIX = dev ? "http://localhost:18000" : "";
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ const generateStaticFiles = async (websiteData: any, isPreview: boolean = true)
|
|||||||
logoType: websiteData.logo_type,
|
logoType: websiteData.logo_type,
|
||||||
logo: websiteData.logo_text,
|
logo: websiteData.logo_text,
|
||||||
coverImage: article.cover_image
|
coverImage: article.cover_image
|
||||||
? `${API_BASE_PREFIX === "/api" ? `${process.env.ORIGIN}/api` : API_BASE_PREFIX}/rpc/retrieve_file?id=${article.cover_image}`
|
? `${API_BASE_PREFIX}/rpc/retrieve_file?id=${article.cover_image}`
|
||||||
: "",
|
: "",
|
||||||
publicationDate: article.publication_date,
|
publicationDate: article.publication_date,
|
||||||
mainContent: md.render(article.main_content ?? ""),
|
mainContent: md.render(article.main_content ?? ""),
|
||||||
@@ -128,7 +128,7 @@ const generateStaticFiles = async (websiteData: any, isPreview: boolean = true)
|
|||||||
logoType: websiteData.logo_type,
|
logoType: websiteData.logo_type,
|
||||||
logo: websiteData.logo_text,
|
logo: websiteData.logo_text,
|
||||||
coverImage: article.cover_image
|
coverImage: article.cover_image
|
||||||
? `${API_BASE_PREFIX === "/api" ? `${process.env.ORIGIN}/api` : API_BASE_PREFIX}/rpc/retrieve_file?id=${article.cover_image}`
|
? `${API_BASE_PREFIX}/rpc/retrieve_file?id=${article.cover_image}`
|
||||||
: "",
|
: "",
|
||||||
publicationDate: article.publication_date,
|
publicationDate: article.publication_date,
|
||||||
mainContent: md.render(article.main_content ?? ""),
|
mainContent: md.render(article.main_content ?? ""),
|
||||||
|
|||||||
Reference in New Issue
Block a user