File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- const API_URL = 'http://localhost:5000/api' ;
1+ const API_BASE_URL = window . location . hostname === 'localhost' || window . location . hostname === '127.0.0.1'
2+ ? 'http://localhost:5000'
3+ : 'https://logitrack-ppnc.onrender.com' ;
4+
5+ const API_URL = `${ API_BASE_URL } /api` ;
26
37const api = {
48 getHeaders : ( ) => {
Original file line number Diff line number Diff line change @@ -8,7 +8,11 @@ document.addEventListener('DOMContentLoaded', function () {
88 const backToWelcomeBtn = document . getElementById ( 'back-to-welcome' ) ;
99 const backToWelcomeBtn2 = document . getElementById ( 'back-to-welcome-2' ) ;
1010
11- const API_URL = 'http://localhost:5000/api/auth' ;
11+ const API_BASE_URL = window . location . hostname === 'localhost' || window . location . hostname === '127.0.0.1'
12+ ? 'http://localhost:5000'
13+ : 'https://logitrack-ppnc.onrender.com' ;
14+
15+ const API_URL = `${ API_BASE_URL } /api/auth` ;
1216
1317 let loginDestination = 'dashboard' ; // Default
1418
You can’t perform that action at this time.
0 commit comments