Skip to content

Fetches with a variable. Read Description for instructions - #26

Open
IbbiSecka wants to merge 1 commit into
mainfrom
fetching-withAPI-Base
Open

Fetches with a variable. Read Description for instructions#26
IbbiSecka wants to merge 1 commit into
mainfrom
fetching-withAPI-Base

Conversation

@IbbiSecka

Copy link
Copy Markdown
Collaborator
  1. Create a .env file in the root of the project(where package .jso files is)
  2. Paste this inside:
    REACT_APP_HTTPS_API_BASE_URL = https://localhost:5001
    REACT_APP_HTTP_API_BASE_URL = http://localhost:5000
  3. Create a file name apiConfig.ts (Many files imports from this exact name so use it) in the src folder of the project.
  4. Pase this inside it:
    const HTTP_API_BASE_URL = process.env.REACT_APP_HTTP_API_BASE_URL!;
    const HTTPS_API_BASE_URL = process.env.REACT_APP_HTTPS_API_BASE_URL!;

export { HTTP_API_BASE_URL, HTTPS_API_BASE_URL };

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