Skip to content

Replace Hardcoded API Endpoints with Environment Variables #31

@AyushDharDubey

Description

@AyushDharDubey

Description

All the utility functions in the project currently use hardcoded API endpoints. For example:

const res = await fetch("http://localhost:3000/api/Tickets", {
  cache: "no-store",
});

Hardcoding URLs can lead to deployment issues when switching between different environments, such as production, staging, or testing. To ensure flexibility and maintainability, these values should be moved to environment variables.


Acceptance Criteria

  • No hardcoded URLs remain in the project.
  • API calls use the process.env.NEXT_PUBLIC_API_URL variable.
  • The README includes updated documentation for environment variable setup.
  • Existing functionality (e.g., data fetching) works as expected in local development environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions