-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
45 lines (43 loc) · 1.23 KB
/
config.js
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
40
41
42
43
44
45
var path = require('path');
const fs = require('fs');
const placeHolderFileName = "no-picture.jpg";
const self = {
PORT: process.env.ITEMS_API_PORT || 8090,
CHANGE_EXCEL_FILE: {
LOCAL_PATH: 'excels',
ABS_PATH: path.join(__dirname, 'excels')
},
CHANGE_TASK_EXCEL_FILE: {
LOCAL_PATH: path.join('excels', 'tasks'),
ABS_PATH: path.join(__dirname, 'excels', 'tasks')
},
CHANGE_ZIP_FILE: {
LOCAL_PATH: 'zip',
ABS_PATH: path.join(__dirname, 'zip')
},
IMAGE_FILE: {
LOCAL_PATH: 'images',
ABS_PATH: path.join(__dirname, 'images')
},
IMAGE_CACHE_FILE: {
LOCAL_PATH: 'cache',
ABS_PATH: path.join(__dirname, 'cache')
},
PLACEHOLDER_IMAGE: {
NAME: placeHolderFileName,
PATH: path.join(__dirname, placeHolderFileName),
},
"dialect": "sqlite",
"storage": "database/database.sqlite",
"logging": null
};
try {
fs.mkdirSync(self.CHANGE_EXCEL_FILE.ABS_PATH)
fs.mkdirSync(self.CHANGE_TASK_EXCEL_FILE.ABS_PATH)
fs.mkdirSync(self.CHANGE_ZIP_FILE.ABS_PATH)
fs.mkdirSync(self.IMAGE_FILE.ABS_PATH)
fs.mkdirSync(self.IMAGE_CACHE_FILE.ABS_PATH)
} catch (error) {
// do nothing
}
module.exports = self;