Move URL settings into .env file

This commit is contained in:
jwu-fisker
2021-01-07 17:01:24 -08:00
parent 1ed43fa2a0
commit 2d4e446a6f
3 changed files with 4 additions and 2 deletions

2
.env.template Normal file
View File

@@ -0,0 +1,2 @@
REACT_APP_AUTH_SERVICE_URL = https://dev-auth.fiskerdps.com
REACT_APP_UPLOAD_SERVICE_URL = http://localhost:8080/api/upload

View File

@@ -1,4 +1,4 @@
const AUTH_URL = 'https://dev-auth.fiskerdps.com';
const AUTH_URL = process.env.REACT_APP_AUTH_SERVICE_URL;
const auth = {
signIn: (username, password) => fetch(`${AUTH_URL}/auth/login`, {

View File

@@ -1,6 +1,6 @@
import axios from 'axios';
const UPLOAD_ENDPOINT = 'http://localhost:8080/api/upload';
const UPLOAD_ENDPOINT = process.env.REACT_APP_UPLOAD_SERVICE_URL;
export const getCancelToken = () => {
const token = axios.CancelToken;