From cbea63dd79042a3399abdc0ab1e869d6a3247b07 Mon Sep 17 00:00:00 2001 From: Jonnie Spratley Date: Sun, 18 Jan 2015 14:00:48 -0800 Subject: [PATCH] updated stackato --- app/.DS_Store | Bin 8196 -> 10244 bytes manifest.yml | 22 +++++++++++++++++----- server.js | 12 ++++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/app/.DS_Store b/app/.DS_Store index 6d8b6e31744dfb8f6f89e0f983be06542a515068..b532b2a7c1dcba2df4db69bb1b6cdc332f3e3710 100644 GIT binary patch delta 1426 zcma)6O-mb56g@K&O+>*7#2_ei+*L)6-sxls|pqR6N?BA41(~d6D5iQgHr)B6Mm|!GiV+pF delta 155 zcmZn(XmOBWU|?W$DortDU;r^WfEYvza8E20o2aKK$O@7N@)=T!lXH^t^K&*9PGg_g zAh?;GgM~vBB+J5(!;s04#83=Vv3Z5C7USkGB3D=@uao*VvE;KLGf){2NN@uQSCHWw f3%@f@=2r>i02&Rll3{W@&(zJ!B@`JUT0Q^(<`5-F 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);