##Openshift pitfall during deployment
###MongoDB address
###Marker Files
By default, openshift will start our nodejs application by running supervisor server.js
.
However we might want to do more(like testing, transform) any changed file when starting our application. For example, our scripts field in package.json
looks like this.
"scripts": {
...
"build": "browserify -t reactify client/client.js -o public/bundle.js",
"server": "supervisor server/server.js",
"start": "npm run build && npm run server"
},
Everytime before we start our server, we want browserify to do something first by running npm start
. To do this we can use marker file. By adding an empty files named use_npm
in our .openshift/markers
directory, our app will start by runnning npm start
. If we do not have .openshift
directory yet, create one.
mkdir -p .openshift/markers
cd .openshift/markers
touch use_npm
Usually some comments is added inside use_npm
file for clarification.
#!/bin/bash
# include this file to make sure it starts by npm start
###Resource