chore(web): Remove API url env variable

This commit is contained in:
Faruk AYDIN
2023-08-28 14:37:10 +02:00
parent 1e2adedcbf
commit e06b7ab87a
8 changed files with 15 additions and 17 deletions

View File

@@ -1,7 +1,6 @@
type Config = {
[key: string]: string;
baseUrl: string;
apiUrl: string;
graphqlUrl: string;
notificationsUrl: string;
chatwootBaseUrl: string;
@@ -10,17 +9,10 @@ type Config = {
const config: Config = {
baseUrl: process.env.REACT_APP_BASE_URL as string,
apiUrl: process.env.REACT_APP_API_URL as string,
graphqlUrl: process.env.REACT_APP_GRAPHQL_URL as string,
notificationsUrl: process.env.REACT_APP_NOTIFICATIONS_URL as string,
chatwootBaseUrl: 'https://app.chatwoot.com',
supportEmailAddress: 'support@automatisch.io'
supportEmailAddress: 'support@automatisch.io',
};
if (!config.apiUrl && !config.graphqlUrl) {
config.apiUrl = '/';
} else if (!config.apiUrl) {
config.apiUrl = (new URL(config.graphqlUrl)).origin;
}
export default config;