Commit 1ff24457 authored by Abdul R. Wahid's avatar Abdul R. Wahid
Browse files

Merge branch 'develop-3' into 'master'

Develop 3

See merge request riset/onest!4
parents cd527ef4 23d01401
const db_mysql = {
export const db_mysql = {
active: true,
host: 'localhost',
port: 3306,
......@@ -10,7 +10,7 @@ const db_mysql = {
charset: "utf8mb4"
}
}
const db_pg = {
export const db_pg = {
active: false,
host: 'localhost',
port: 5432,
......@@ -19,7 +19,7 @@ const db_pg = {
name: 'database',
options: {}
}
const db_mongo = {
export const db_mongo = {
active: false,
host: 'localhost',
port: 27000,
......@@ -27,8 +27,3 @@ const db_mongo = {
pass: '',
name: 'speeda',
}
export {
db_mysql,
db_pg,
db_mongo
}
const extras = {
export const extras = {
cloudinary: {
connection: {
cloud_name: '',
......@@ -43,6 +43,3 @@ const extras = {
}
}
}
export {
extras
}
import { db_mysql, db_pg, db_mongo } from '@config/development.database'
import { extras } from '@config/development.extras'
import { db_mysql, db_pg, db_mongo } from './sample.database'
import { extras } from './sample.extras'
const development = {
authlog: {
active: false
......
......@@ -110,6 +110,6 @@
"@database": "./dist/src/database",
"@module": "./dist/src/module",
"@core": "./dist/src/core",
"@config": "./dist/config"
"@config": "./dist/src/config"
}
}
import * as fs from 'fs'
import * as _ from 'lodash'
import * as convict from 'convict'
import * as pkg from '../package.json'
import * as pkg from '../../package.json'
import * as dotenv from 'dotenv'
// Load & Sync .env
......@@ -68,8 +68,8 @@ const config = convict(configSchema)
const env = process.env.NODE_ENV = config.get('env')
// Load environment dependent configuration
if (fs.existsSync(`./config/${env}.ts`)) {
const data = require(`@config/${env}`)
if (fs.existsSync(`./config/${env}.ts`) || fs.existsSync(`./config/${env}.js`)) {
const data = require(`../../config/${env}`)
config.load(data.default)
} else {
console.log(`[Config] - ${(new Date()).toString()} [Loader] Not load ${env} environment configuration file`)
......@@ -77,5 +77,4 @@ if (fs.existsSync(`./config/${env}.ts`)) {
// Perform validation
config.validate({ allowed: 'strict' })
export default config
......@@ -18,7 +18,7 @@
"@database*": ["src/database*"],
"@module*": ["src/module*"],
"@core*": ["src/core*"],
"@config*": ["config*"]
"@config*": ["src/config*"]
}
},
"exclude": ["node_modules", "dist", "data"]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment