diff --git a/client/src/api/api.js b/client/src/api/api.js index 85c8536..2367339 100644 --- a/client/src/api/api.js +++ b/client/src/api/api.js @@ -1,5 +1,12 @@ import axios from "axios"; +/* +If serve static dev -> host = localhost:3000 +If concurrent dev -> host = localhost:5000 +If production -> host = 'https://lsu-it-support-demo.herokuapp.com/' +*/ +const PORT = process.env.PORT || 5000; +const HOST = process.env.HOST || `localhost:${PORT}` export default axios.create({ - baseURL: `http://localhost:3000/api/`, + baseURL: `http://${HOST}/api/`, });