-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure frontend to use api gateway
- Loading branch information
1 parent
2ad5ce7
commit 278a4f8
Showing
3 changed files
with
37 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { API_CONFIG } from '../app/api.config'; | ||
|
||
/** | ||
* Abstract class that serves as a base for API services. | ||
*/ | ||
export abstract class ApiService { | ||
/** | ||
* The path for the specific resource, e.g. 'user', 'question', etc. | ||
* This property must be implemented by subclasses to specify the | ||
* endpoint path for the API resource they represent. | ||
*/ | ||
protected abstract apiPath: string; | ||
|
||
/** | ||
* Returns the full URL for the API endpoint based on | ||
* the specified apiPath. | ||
*/ | ||
get apiUrl(): string { | ||
return API_CONFIG.baseUrl + this.apiPath; | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const API_CONFIG = { | ||
baseUrl: 'http://localhost:8081', | ||
baseUrl: 'http://localhost:8080/api/', | ||
}; |