-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
24 lines (21 loc) · 861 Bytes
/
config.js
File metadata and controls
24 lines (21 loc) · 861 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
const path = require("node:path");
const parseEnvBoolean = (value) => {
if (value === undefined || value === null) {
return false;
}
return ["1", "true", "yes", "on"].includes(String(value).toLowerCase());
};
const config = {
ROOT_DIR: __dirname,
URL_PORT: 1338,
URL_PATH: "https://api.developer.overheid.nl",
BASE_VERSION: "/tools/v1",
CONTROLLER_DIRECTORY: path.join(__dirname, "controllers"),
PROJECT_DIR: __dirname,
USE_MOCKS: parseEnvBoolean(process.env.USE_MOCKS) || parseEnvBoolean(process.env.MOCKS_ENABLED),
};
config.OPENAPI_JSON = path.join(config.ROOT_DIR, "api", "openapi.json");
config.FULL_PATH = `${config.URL_PATH}:${config.URL_PORT}/${config.BASE_VERSION}`;
config.FILE_UPLOAD_PATH = path.join(config.PROJECT_DIR, "uploaded_files");
config.MOCK_DIR = path.join(config.PROJECT_DIR, "mocks");
module.exports = config;