# Deploy ionic app as a website

**URL:** <https://forum.ionicframework.com/t/deploy-ionic-app-as-a-website/2845>\
**Category:** ionic-v1\
**Created:** [April 10, 2014, 1:09pm UTC](https://forum.ionicframework.com/t/deploy-ionic-app-as-a-website/2845 "2014-04-10T13:09:00Z")\
**Posts on this page:** 1\
**Showing post:** 40

<div class="post-metadata">

**Author:** ![csepic](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/csepic/32/98079_2.png) [@csepic](https://forum.ionicframework.com/u/csepic)\
**Post date:** [March 9, 2016, 5:58pm UTC](https://forum.ionicframework.com/t/deploy-ionic-app-as-a-website/2845/40 "2016-03-09T17:58:02Z")

</div>

I’m a developer on one of the apps @linjeffmn mentioned above. We’re hosting our web version on Heroku. I used the following Node.js buildpack:

> **[timdp/heroku-buildpack-nodejs-gulp](https://github.com/timdp/heroku-buildpack-nodejs-gulp)**
>
> heroku-buildpack-nodejs-gulp - A slightly modified version of Heroku's official Node.js buildpack with added gulp.js support.

The main challenge was figuring out how to set up environment specific variables that I could use in the app. In package.json I have the following entry:

```auto
"scripts": {
  "postinstall": "./node_modules/.bin/gulp config"
}

```

And in gulpfile.js:

```auto
gulp.task('config', function () {
  var env = sh.env['NODE_ENV'];
  var src = "envs/" + env + "/config.json";  
  gulp.src(src)
    .pipe(ngConstant({
      name: 'myapp.config'
    }))
    .pipe(gulp.dest('www/js'));
});

```

I then have /envs/[environment name] folders each with a config.json that contains any environment-specific config vars:

```auto
{
    "MY_VAR": "something"
}

```

At the top of app.js, I can then require it so those variables are injectable:

```auto
angular.module('myapp', ['ionic', 'myapp.config'])

```

I also hid certain functionality in the web version that obviously didn’t make sense, like notifications. Pretty straightforward:

```auto
$scope.isWeb = (typeof window.plugin === "undefined");

```

Again this is not exactly recommended, but worked for our needs.

---

_[View the full topic](https://forum.ionicframework.com/t/deploy-ionic-app-as-a-website/2845)._
