1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-19 21:29:41 +02:00
codex.docs/config/index.js
George Berezhnoy 404fb4642e
Transport controller and file model (#42)
* Transport controller and file model

* Use randomBytes intead of pseudoRandomBytes

* Cover all lines with tests

* Update code style

* Update code style

* View for image block

* Fix serving static files

* Mkdir -p for uploads dirs

* Add default secret param

* Add image Tool

* Update src/utils/objects.js

Co-Authored-By: talyguryn <vitalik7tv@yandex.ru>

* Use vars for image tool colors

* Revert var

* Remove --color-gray-border var

* Update src/controllers/transport.js

Co-Authored-By: talyguryn <vitalik7tv@yandex.ru>

* Add mp4 support for Image Tool
2019-03-11 18:44:00 +03:00

24 lines
492 B
JavaScript

/**
* This module reads configuration file depending on NODE_ENV
*
* @type {module}
*/
const fs = require('fs');
const path = require('path');
const NODE_ENV = process.env.NODE_ENV || 'development';
const configPath = `./${NODE_ENV}.json`;
let config;
if (fs.existsSync(path.resolve(__dirname, configPath))) {
config = require(configPath);
} else {
config = {
database: '.db',
port: 3000,
uploads: 'public/uploads',
secret: 'secret'
};
}
module.exports = config;