Skip to content

Bug: Hardcoded Localhost API URL in SvelteKit Standalone Card Server Loader #218

@anshul23102

Description

@anshul23102

Description

The server load function for SvelteKit /devcard/[id] route fetches the card data from the backend by calling a hardcoded URL: http://localhost:3000/api/u/card/${id}. In contrast, other server load routes (like /u/[username]) dynamically configure the API base URL using process.env.BACKEND_URL. The hardcoded URL prevents the standalone card view from functioning correctly in production environments.

Source Code Location

File: apps/web/src/routes/devcard/[id]/+page.server.ts

Proposed Fix

Update the server load function to use the environment variable for dynamic base URL configuration.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions