You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
573 B

import path from 'path'
import dotenv from 'dotenv'
/**
* getting emv amd merge with basic values
*
*
*/
function config() {
// getting dir
const server_dir = path.resolve()
const base_dir = path.join(server_dir, '/../..')
dotenv.config({ path: base_dir + '/.env' })
const config = {
APP_BASE_DIR: base_dir,
APP_SERVER_DIR: server_dir,
APP_SQLITE_URI_MAIN: path.join(base_dir, '/storage/main.db'),
APP_HASH_TYPE: 'sha512'
}
// merge
dotenv.populate(process.env, config)
}
export default config