diff --git a/app/.DS_Store b/app/.DS_Store index 6d8b6e3..b532b2a 100644 Binary files a/app/.DS_Store and b/app/.DS_Store differ diff --git a/manifest.yml b/manifest.yml index a122269..e23f244 100644 --- a/manifest.yml +++ b/manifest.yml @@ -1,5 +1,17 @@ ---- -applications: -- name: angular-cms - command: node server.js - buildpack: https://github.com/cloudfoundry/heroku-buildpack-nodejs.git \ No newline at end of file +name: angular-cms +framework: node +instances: 1 +mem: 256 +processes: + web: node server.js +ignores: ['.git', 'node_modules', 'app/bower_components'] +hooks: +# pre-push: + #- gulp test + pre-staging: + - bower install + - grunt +# post-staging: + #- python manage.py syncdb --noinput +# pre-running: + #- python prerunsetup.py diff --git a/server.js b/server.js index 67ea21f..b3a11ac 100755 --- a/server.js +++ b/server.js @@ -7,5 +7,17 @@ var fs = require('fs'); var cmsRouter = require('./routes/cms-router.js'); var app = express(); var config = JSON.parse(fs.readFileSync('./config/config.json')); + +//Test if services +if(process.env.VCAP_SERVICES){ + var cloudServices = JSON.parse(process.env.VCAP_SERVICES); + + console.warn('cloud services', cloudServices); + //var dbcreds = services['mongodb'][0].credentials; +} +var port = process.env.PORT || 1339; +var host = process.env.VCAP_APP_HOST || "127.0.0.1"; +config.host = host; +config.port = port; var server = new cmsRouter.mount(config, app); console.log(server);