Skip to content

Use env-driven API base URL (Vite env) instead of hardcoded #11

@sugan0tech

Description

@sugan0tech

Summary
Use a Vite environment variable for API base URL instead of a hardcoded localhost constant.

Context
src/utils/api.ts defines BASE_URL = "http://localhost:8080/api". This blocks environment-specific configuration for staging/production.

Tasks

  • Read base URL from import.meta.env.VITE_API_BASE_URL with a sensible dev default.
  • Add .env.example documenting VITE_API_BASE_URL.
  • Update README with configuration instructions for local dev and deployments.
  • Verify cookie/security options remain appropriate (e.g., secure only in production).

Acceptance Criteria

  • Local dev reads value from .env (or defaults to localhost) and works.
  • Production build uses the injected value from environment at build time.
  • No hardcoded API host remains in the codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions