diff --git a/src/config/development.dist.js b/src/config/development.dist.js new file mode 100644 index 0000000..3377571 --- /dev/null +++ b/src/config/development.dist.js @@ -0,0 +1,12 @@ +export default { + environment: 'development', + port: 3000, + bodyLimit: '300kb', + db: { + host: 'localhost', + user: '~', + password: '~', + timezone: '+00:00', + decimalNumbers: true + } +} diff --git a/src/config/index.js b/src/config/index.js new file mode 100644 index 0000000..b15cc7b --- /dev/null +++ b/src/config/index.js @@ -0,0 +1,17 @@ +import process from 'node:process' +import development from './development.js' +import production from './production.js' + + +const getConfig = () => { + const env = process.env.NODE_ENV || 'development' + + const equivalences = { + development, + production + } + + return equivalences[env]; +} + +export default getConfig(); \ No newline at end of file diff --git a/src/config/production.dist.js b/src/config/production.dist.js new file mode 100644 index 0000000..4fb276b --- /dev/null +++ b/src/config/production.dist.js @@ -0,0 +1,12 @@ +export default { + environment: 'production', + port: 3005, + bodyLimit: '300kb', + db: { + host: 'localhost', + user: '~', + password: '~', + timezone: '+00:00', + decimalNumbers: true + } +} diff --git a/src/config/test.dist.js b/src/config/test.dist.js new file mode 100644 index 0000000..3777f8c --- /dev/null +++ b/src/config/test.dist.js @@ -0,0 +1,12 @@ +export default { + environment: 'test', + port: 3005, + bodyLimit: '300kb', + db: { + host: 'localhost', + user: '~', + password: '~', + timezone: '+00:00', + decimalNumbers: true + } +}