mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 01:18:34 +00:00
63 lines
2.1 KiB
TypeScript
63 lines
2.1 KiB
TypeScript
|
|
// This file fixes some of the old Netlify/Environment variable cruft that was introduced.
|
|
// Rather than having 11+ env vars that live in Netlify's stupid UI, we should switch on
|
|
// one environment var and use centralized and versioned configs.
|
|
export enum Environment {
|
|
Dev,
|
|
DevProxy,
|
|
Staging,
|
|
Production,
|
|
}
|
|
|
|
export class Configs {
|
|
// API backend (protocol + hostname)
|
|
readonly baseApi: string = "https://api.storyteller.ai";
|
|
|
|
// CDN (protocol + hostname)
|
|
readonly cdnApi: string = "https://cdn.storyteller.ai";
|
|
|
|
// Where we're deployed
|
|
readonly deployContext: string;
|
|
|
|
// ??? legacy setting ???
|
|
readonly expressions: boolean = true;
|
|
|
|
// I assume this is the preview server.
|
|
// TODO: Rename when confirmed.
|
|
readonly funnelApi: string = "https://style.storyteller.ai";
|
|
|
|
// Why the hell was this even introduced as a variable?
|
|
readonly googleApi: string = "https://storage.googleapis.com";
|
|
|
|
// Why the hell was this even introduced as a variable?
|
|
readonly gravatarApi: string = "https://www.gravatar.com";
|
|
|
|
// Why the hell was this even introduced as a variable?
|
|
readonly mediaVideoApi: string = "https://storage.googleapis.com/vocodes-public";
|
|
|
|
// ??? Something seems to be locked behind this flag in production
|
|
readonly premiumLock: boolean = true;
|
|
|
|
readonly uploadApiVideo = "https://upload.storyteller.ai";
|
|
|
|
// Why does this have almost the same name? Gross!
|
|
readonly uploadVideoApi = "https://api.storyteller.ai/v1/media_files/upload/new_video";
|
|
|
|
constructor(environment: Environment) {
|
|
switch (environment) {
|
|
case Environment.Dev:
|
|
this.deployContext = "DEVELOPMENT";
|
|
break;
|
|
case Environment.DevProxy:
|
|
this.deployContext = "DEVELOPMENT";
|
|
break;
|
|
case Environment.Staging:
|
|
this.deployContext = "STAGING";
|
|
break;
|
|
case Environment.Production:
|
|
this.deployContext = "PRODUCTION";
|
|
this.premiumLock = false;
|
|
break;
|
|
}
|
|
}
|
|
} |