Created
October 8, 2022 05:45
-
-
Save devAgam/77d7358dbff592c07ca12c841cabff20 to your computer and use it in GitHub Desktop.
URL Ternary decider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from "axios"; | |
const baseUrlMainServer = | |
process.env.ENV === "PROD" | |
? "https://api.project28.in" | |
: process.env.ENV === "QA" | |
? "https://qa.project28.in" | |
: (process.env.ENV = "DEV" | |
? "https://backend-staging.project28.in" | |
: "http://localhost:5000"); | |
// const baseUrlMainServer = "http://localhost:5000/api/v1"; | |
export default axios.create({ | |
baseURL: baseUrlMainServer + "/api/v1", | |
withCredentials: true, | |
headers: { "Content-Type": "application/json" }, | |
}); | |
export const axiosPrivate = axios.create({ | |
baseURL: baseUrlMainServer + "/api/v1", | |
headers: { "Content-Type": "application/json" }, | |
withCredentials: true, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment