|
1 | | -import * as path from 'path' |
| 1 | +import * as path from "path" |
2 | 2 |
|
3 | 3 | /** Get the full path of a filename from root */ |
4 | 4 | const rootPath = (filename: string) => path.resolve(__dirname, `../${filename}`) |
5 | 5 |
|
6 | | -require('dotenv').config({ path: rootPath('.env') }) |
| 6 | +require("dotenv").config({ path: rootPath(".env") }) |
7 | 7 |
|
8 | 8 | // Helper to read from env with a safe default so production doesn't require a .env file |
9 | 9 | const fromEnv = (key: string, fallback: string): string => { |
10 | 10 | const val = process.env[key] |
11 | | - return typeof val === 'string' && val.length > 0 ? val : fallback |
| 11 | + return typeof val === "string" && val.length > 0 ? val : fallback |
12 | 12 | } |
13 | 13 |
|
14 | 14 | export const AppConfig = { |
15 | 15 | app: { |
16 | 16 | // Key name for VS Code SecretStorage. Not a credential; safe to default. |
17 | | - sessionSecret: fromEnv('SESSIONS_SECRET_KEY', 'pullflow.session'), |
| 17 | + sessionSecret: fromEnv("SESSIONS_SECRET_KEY", "pullflow.session"), |
18 | 18 | // Public identifier for the client used during auth redirects. |
19 | | - clientIdentifier: fromEnv('CLIENT_IDENTIFIER', 'com.pullflow.vscode'), |
| 19 | + clientIdentifier: fromEnv("CLIENT_IDENTIFIER", "com.pullflow.vscode"), |
20 | 20 | }, |
21 | 21 | pullflow: { |
22 | 22 | // Public service endpoints; default to production URLs. |
23 | | - baseUrl: fromEnv('PULLFLOW_APP_URL', 'https://app.pullflow.com'), |
| 23 | + baseUrl: fromEnv("PULLFLOW_APP_URL", "https://app.pullflow.com"), |
24 | 24 | graphqlUrl: `${fromEnv( |
25 | | - 'PULLFLOW_APP_URL', |
26 | | - 'https://app.pullflow.com' |
| 25 | + "PULLFLOW_APP_URL", |
| 26 | + "https://app.pullflow.com" |
27 | 27 | )}/api/graphql`, |
28 | 28 | telemetryUrl: fromEnv( |
29 | | - 'PULLFLOW_TELEMETRY_URL', |
30 | | - 'https://collector.pullflow.cloud' |
| 29 | + "PULLFLOW_TELEMETRY_URL", |
| 30 | + "https://collector.pullflow.cloud" |
31 | 31 | ), |
32 | 32 | }, |
33 | 33 | } |
0 commit comments