github - Change source file code before publishing on production site using git -


i have created 1 project using node.js , publish using git. per logic, have change variable's value in 'app.js' file (e.g. app environment 'development' 'production', static file path, database connection etc.) every time before publish without fail, else problem occur on production. it's hack tic job , need focus while publishing website production. there option/command in git above stuff automatically?

move config variable config file ex: config.js , use in app.js.

basically in config.js can define variable in if...else condition block per development or production.

if(inproduction()) {  // define production variable } else {   // define developement variable } 

note:define inproduction method in config return true if it's production else return false.

hope helps you.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -