Skip to content
This repository has been archived by the owner on Dec 26, 2024. It is now read-only.

Feature: Change endpoint URL based on environment #56

Open
1 of 2 tasks
esthersoftwaredev opened this issue Jul 7, 2024 · 0 comments
Open
1 of 2 tasks

Feature: Change endpoint URL based on environment #56

esthersoftwaredev opened this issue Jul 7, 2024 · 0 comments
Labels

Comments

@esthersoftwaredev
Copy link
Member

esthersoftwaredev commented Jul 7, 2024

Type of feature

✨ Feature

Current behavior

  • right now all api calls are made to https://builtwithanalog.dev/api/projects which is the production endpoint
  • during development I am changing to http://localhost:5173/api/projects

Suggested solution

yes of course it will be more convenient to change the apiURL based on environment like I do for all other apps, has not been implemented over here yet

  • one option is to use vite
    const apiUrl = import.meta.env.VITE_API_URL;

with

# .env
VITE_API_URL=http://localhost:5173/api/projects

and

# .env.production
VITE_API_URL=https://builtwithanalog.dev/api/projects

but doesn't have to be this option, will consider and get to it at some point

Additional context

vite docs

I would be willing to submit a PR to fix this issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant