Skip to content

Commit

Permalink
Merge pull request #184 from hackmcgill/develop
Browse files Browse the repository at this point in the history
V1.1.0?
  • Loading branch information
pierreTklein authored Dec 13, 2018
2 parents 6043405 + 58fd631 commit c080b87
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,11 @@ class API {
}
}

export default new API(CONSTANTS.API_URL);
let API_URL;
if (location.hostname === "localhost" || location.hostname === "127.0.0.1" || location.hostname === "") {
API_URL = CONSTANTS.LOCAL_API_URL;
} else {
API_URL = CONSTANTS.PROD_API_URL;
}

export default new API(API_URL);
6 changes: 5 additions & 1 deletion src/config/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export const API_URL = 'http://localhost:3000/api';
export const LOCAL_API_URL = 'http://localhost:3000/api';
export const PROD_API_URL = 'https://api.mchacks.ca/api/';

//

export const CACHE_USER_KEY = 'userInfo';
export const CACHE_HACKER_KEY = 'hackerInfo';

Expand Down

0 comments on commit c080b87

Please sign in to comment.