config_public.js 2.68 KB
Newer Older
1
2
3
4
5
6
7
8
/*
    ### Configurations File.

    - 해당 파일은 공개용으로 작성한 것 입니다. 동일 디렉토리 상에서 config.js를 생성해 사용합니다.
    - 환경 변수들을 관리하는 파일입니다.
    - 개발 환경에 맞게 값들을 변경하여 사용합니다.
*/

9
10
11
12
13
14
15
16
17
18
// State Production or Development.
const PRODUCTION = false;

// # Client Envs
const CLIENT_PROTOCOL = PRODUCTION ? "https" : "http";
const CLIENT_HOST = PRODUCTION ? "YOUR_PRODUCTION_HOST" : "localhost";
const CLIENT_PORT = PRODUCTION
  ? "YOUR_PRODUCTION_PORT"
  : "YOUR_DEVELOPMENT_PORT";

19
// # Server Envs
20
21
22
23
24
const SERVER_PROTOCOL = PRODUCTION ? "https" : "http";
const SERVER_HOST = PRODUCTION ? "YOUR_PRODUCTION_HOST" : "localhost";
const SERVER_PORT = PRODUCTION
  ? "YOUR_PRODUCTION_PORT"
  : "YOUR_DEVELOPMENT_PORT";
25
26

// # DB Info.
27
28
29
30
31
32
const DB_USER = PRODUCTION
  ? "YOUR_PRODUCTION_DB_USER"
  : "YOUR_DEVELOPMENT_DB_USER";
const DB_PASSWORD = PRODUCTION
  ? "YOUR_PRODUCTION_DB_PASSWORD"
  : "YOUR_DEVELOPMENT_DB_PASSWORD";
33
34
const DB_HOST = "localhost";
const DB_PORT = "5432";
35
36
37
const DB_DATABASE = PRODUCTION
  ? "YOUR_PRODUCTION_DB_NAME"
  : "YOUR_DEVELOPMENT_DB_NAME";
38
39
40
41
42
43

// # API.

// ## OpenWeatherMap
const OPENWEATHERMAP_API_KEY = "YOUR_OpenWeatherMap_API_KEY";

44
// ## Nodemailer.
45
46
47
48
49
50
51
52
53
const NODEMAILER_SERVICE = "gmail";
const NODEMAILER_USER = "YOUR_MAIL_ADDRESS";
const NODEMAILER_GAMIL_CLIENT_ID = "YOUR_API_CLIENT_ID";
const NODEMAILER_GMAIL_REFRESH_TOKEN = "YOUR_GMAIL_REFRESH_TOKEN";

// # Secret Key.
const AUTH_MAIL_SECRETKEY = "YOUR_MAIL_SECRETKEY";
const AUTH_ACCESS_TOKEN_SECRETKEY = "YOUR_ACCESS_TOKEN_SECRETKEY";

54
55
56
57
// # Server Inner DIR
const DIR_DATA_PROCESSING_MAIN = "/src/data_processing/main.py";
const DIR_DATA_PROCESSING_PREDICTION = "/src/data_processing/predict.py";

58
const envs = {
59
60
61
62
63
64
  production: PRODUCTION,
  client: {
    protocol: CLIENT_PROTOCOL,
    host: CLIENT_HOST,
    port: CLIENT_PORT,
  },
65
  server: {
66
67
68
    protocol: SERVER_PROTOCOL,
    host: SERVER_HOST,
    port: SERVER_PORT,
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
  },
  db: {
    user: DB_USER,
    password: DB_PASSWORD,
    host: DB_HOST,
    port: DB_PORT,
    database: DB_DATABASE,
  },
  api: {
    openweathermap: {
      api_key: OPENWEATHERMAP_API_KEY,
    },
    nodemailer: {
      service: NODEMAILER_SERVICE,
      user: NODEMAILER_USER,
      gmail_client_id: NODEMAILER_GAMIL_CLIENT_ID,
85
      gmail_client_secret: NODEMAILER_GMAIL_CLIENT_SECRET,
86
87
88
89
90
91
92
      gmail_refresh_token: NODEMAILER_GMAIL_REFRESH_TOKEN,
    },
  },
  secretKey: {
    mail: AUTH_MAIL_SECRETKEY,
    access_token: AUTH_ACCESS_TOKEN_SECRETKEY,
  },
93
94
95
96
  inner_dir: {
    data_processing_main: DIR_DATA_PROCESSING_MAIN,
    data_processing_prediction: DIR_DATA_PROCESSING_PREDICTION,
  },
97
98
99
};

export default envs;