Monday, December 15, 2014

More bluemix!

I've been playing with Bluemix during the last few weeks and now I have a few interesting tips for you:

  • Always check the logs/staging_task.log. You can find interesting stuff when the Bluemix controller try to instantiate your app. There are a few things that are not quite well documented and may save your life. One example is on my next tip.
  • Add a start script into your package.json. Even when the application will start if you set up the manifest.yml, the Bluemix Controller needs this info to be able to instrument your app, which leads to my next tip. In the meantime, here you have a sample package.json with a start script:
{
  "name": "sample",
  "version": "0.1.0",
  "description": "sample",
  "main": "sample",
  "scripts": {
    "test": "echo \"Error: no test specified! Configure in package.json\" && exit 1",
    "start": "node app.js"
  },
  "dependencies": {    
    "express": "3.4.7",
    "jade": "1.1.4",
    "log4js": "^0.6.21",    
  },  
  "author": "",
  "license": "BSD",
  "readmeFilename": "README.md",
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-env": "^0.4.2",
    "grunt-git": "^0.3.2",
    "grunt-shell": "^1.1.1",
    "js-yaml": "^3.2.3"
  }
}
  • Using the IBM Monitoring and Analytics for Bluemix Add-On is free, so I highly recommend to use it. It may help you a lot to find some issues in your apps.
I'll keep adding more tips as I find them useful enough.

No comments: