SPA Web
The documentation applies to: v0.8.0
Client configuration file¶
Same with most Angular projects, we have some environment.ts files on environments
folder.
Each environment file is used to run on specific environment such as local
, docker
, etc. But we will come back this on Multiple Environments
Now open one environment file and you will see a data structure
export const environment = {
production: false, // Enable to true when we deploy on Production
version: "0.0.5", // Current deployed version, useful to track user's version
configurationEndpoint: "http://localhost:53595/v1.0/api/configurations/Portal/v1.0",
// Where to get Server configuration file
ignoreSendTokenEndpoints: "api/accounts/login;api/accounts/refresh;api/accounts/forgot-password;api/accounts/recovery-password",
// Ignore attach JWT token to HTTP Header when calling HTTP
chatOptions: {
allowFileTypes: 'jpg;jpeg;gif;png;zip;rar;doc;docx;xls;xlsx;pdf', // Chat Attachment file
maxFileSizeInMb: 16 // Chat attachment file size
}
};
Server configuration file¶
LET Portal not only provides client-configuration file but also server-cofiguration file for SPA Web. A main reason is a complexity of multiple environments on server-side. Nowaday, we always have at least three environments such as Local, Staging and Production.
If you keep these configurations that belong to server-side such as service's endpoints, Consumer Key/Secret, feature toggles on client-side, you will jump into a hole. So an easiest solution is letting server-side to handle it and return when SPA web wants.
File Location: src/web-apis/LetPortal.ServiceManagementApis/Files/Portal/v1.0
There are some configuration files that are supporting to deploy Multiple Environments. However, they have a same data structured:
{
"portalBaseEndpoint": "http://localhost:53595/v1.0",// Base endpoint of Portal APIs
"chatBaseEndpoint": "http://localhost:51622",// Base endpoint of Chat APIs
"identityBaseEndpoint": "http://localhost:51620"// Base endpoint of Identity APIs
}