SpaceAPI: get origin by env

This commit is contained in:
He4eT 2025-05-30 16:34:20 +02:00
commit cafbd5bafe

View file

@ -34,7 +34,7 @@ const absoluteURL = (origin: string) => (url: string) =>
export default ({ strapi }: { strapi: Core.Strapi }) => ({ export default ({ strapi }: { strapi: Core.Strapi }) => ({
async index(ctx: Context) { async index(ctx: Context) {
const origin = ctx.request.origin; const origin = process.env.APP_URL ?? ctx.request.origin;
const result = {} as Record<string, any>; const result = {} as Record<string, any>;
result.api_compatibility = [SPACE_API_VERSION]; result.api_compatibility = [SPACE_API_VERSION];