Skip to content

Replace hardcoded API base URL with environment variable#105

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/replace-hardcoded-api-url
Draft

Replace hardcoded API base URL with environment variable#105
Copilot wants to merge 2 commits intomasterfrom
copilot/replace-hardcoded-api-url

Conversation

Copy link

Copilot AI commented Jan 3, 2026

All instances of https://extiri.com were hardcoded across Svelte components. This change extracts the base URL to a PUBLIC_API_BASE_URL environment variable for configurability.

Changes

  • .env.example — Added with default PUBLIC_API_BASE_URL=https://extiri.com
  • Route components — Updated 4 files to import from $env/static/public and use template literals for URL construction:
    • src/routes/+page.svelte (3 URLs)
    • src/routes/account/+page.svelte (6 URLs)
    • src/routes/create/+page.svelte (1 URL)
    • src/routes/snippet/+page.svelte (4 URLs)

Usage

import { PUBLIC_API_BASE_URL } from '$env/static/public';

const response = await fetch(`${PUBLIC_API_BASE_URL}/api/1/snippets/`);

The .env file is already gitignored; .env.example provides the template.

Original prompt

Make it so all the instances of the hardcoded API base URL (like "https://extiri.com") get replaced with a usage of an environment variable. Include a default .env in the project that uses the current base URL.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link

vercel bot commented Jan 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
snippex Error Error Jan 3, 2026 2:52pm

Co-authored-by: wiktorwojcik112 <18286084+wiktorwojcik112@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace hardcoded API base URL with environment variable Replace hardcoded API base URL with environment variable Jan 3, 2026
Copilot AI requested a review from wiktorwojcik112 January 3, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants