-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ts
More file actions
39 lines (35 loc) · 1012 Bytes
/
Copy pathconfig.ts
File metadata and controls
39 lines (35 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import dotenv from 'dotenv';
import path from 'path';
// Load environment variables from .env file
dotenv.config({ path: path.resolve(__dirname, '../../.env') });
interface Config {
port: number;
nodeEnv: string;
logLevel: string;
sharepoint: {
tenantId: string;
clientId: string;
clientSecret: string;
siteUrl: string;
};
auth: {
bearerToken: string;
expiresIn: string;
};
}
const config: Config = {
port: parseInt(process.env.PORT || '3000', 10),
nodeEnv: process.env.NODE_ENV || 'development',
logLevel: process.env.LOG_LEVEL || 'info',
sharepoint: {
tenantId: process.env.SHAREPOINT_TENANT_ID || '',
clientId: process.env.SHAREPOINT_CLIENT_ID || '',
clientSecret: process.env.SHAREPOINT_CLIENT_SECRET || '',
siteUrl: process.env.SHAREPOINT_SITE_URL || '',
},
auth: {
bearerToken: process.env.API_BEARER_TOKEN || 'default-token-for-development-only',
expiresIn: process.env.TOKEN_EXPIRES_IN || '1d',
},
};
export default config;