Skip to content

Commit

Permalink
fixing Heroku deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
sizov committed May 14, 2016
1 parent 0233d9a commit c36e362
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,27 @@ $ npm run clean

Removes the compiled app file from build.

## Deploying to Heroku

Build/deploy pipeline of this project relies on two environment variables:
```
NPM_CONFIG_PRODUCTION=false
PRODUCTION=true
```
When it comes to deploying to Heroku you have two options for deployment:

### With "Deploy to Heroku" button
If you deploy on Heroku with the button on top of this page, you don't need to change anything as environment varialbes are read from `app.json`

### With console
If you deploy to Heroku via command line (like in [this](https://devcenter.heroku.com/articles/getting-started-with-nodejs#deploy-the-app) tutorial), you will need to setup these 2 env variables.
In order to do this, execute next lines from console once you setup Heroku:

```
heroku config:set NPM_CONFIG_PRODUCTION=false
heroku config:set PRODUCTION=true
```

If you don't do this, Heroku will fail to build your app (during `git push heroku master`) as environment variables will not be set.

## [Changelog](CHANGELOG.md)
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import express from 'express';
var express = require('express');
const app = express();


Expand Down

0 comments on commit c36e362

Please sign in to comment.