Skip to content
This repository was archived by the owner on Jul 31, 2020. It is now read-only.

Commit b1995f9

Browse files
committed
fix: npm start should work for heroku
1 parent d9c6bd2 commit b1995f9

File tree

4 files changed

+35
-11
lines changed

4 files changed

+35
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ coverage
2525

2626
# Compiled binary addons (http://nodejs.org/api/addons.html)
2727
build/Release
28+
dist
2829

2930
# Dependency directories
3031
node_modules

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
# nutrient
2-
The nutritional fact database's website
2+
3+
The nutritional fact database's website.
4+
5+
[![Codeship](https://img.shields.io/codeship/a91d02c0-c44d-0134-63d5-3ea79dd40178.svg)]()
6+
[![Gemnasium](https://img.shields.io/gemnasium/anthillsolutions/nutrient.svg)]()
7+
[![label](https://img.shields.io/github/issues/anthillsolutions/nutrient.svg)]()
8+
[![license](https://img.shields.io/github/license/anthillsolutions/nutrient.svg)]()

gulpfile.babel.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import browserSync from 'browser-sync';
88

99
const $ = gulpLoadPlugins();
1010
const SERVER = 'dist/server';
11+
const PORT = process.env.PORT || 5000;
12+
const ENV = process.env.NODE_ENV || 'development';
13+
1114
browserSync.create();
1215
dotenv.config({silent: true});
1316

@@ -52,8 +55,14 @@ gulp.task('reload', ['default'], () => {
5255
* launch an express server
5356
*/
5457
gulp.task('serve', () => {
55-
const server = $.liveServer.new('server/server.js');
56-
server.start();
58+
let server;
59+
if (ENV === 'production') {
60+
server = $.liveServer(SERVER + '/server.js', undefined, false);
61+
server.start();
62+
} else {
63+
server = $.liveServer(SERVER + '/server.js');
64+
server.start();
65+
}
5766
});
5867

5968
/**
@@ -71,3 +80,12 @@ gulp.task('clean', () => {
7180
* Build the project and test for it's consistency
7281
*/
7382
gulp.task('test', ['jscs']);
83+
84+
/**
85+
* Task build
86+
* Build the project
87+
*/
88+
gulp.task('build', ['clean'], () => {
89+
return gulp.src('server/**/*.js')
90+
.pipe(gulp.dest(SERVER));
91+
});

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,20 @@
2222
},
2323
"homepage": "https://github.com/anthillsolutions/nutrient#readme",
2424
"dependencies": {
25+
"babel-core": "^6.22.1",
26+
"babel-preset-es2015": "^6.22.0",
27+
"del": "^2.2.2",
2528
"dotenv": "^4.0.0",
26-
"express": "^4.14.0"
29+
"express": "^4.14.0",
30+
"gulp": "^3.9.1",
31+
"gulp-live-server": "0.0.30",
32+
"gulp-load-plugins": "^1.4.0"
2733
},
2834
"devDependencies": {
29-
"babel-core": "^6.22.1",
30-
"babel-preset-es2015": "^6.22.0",
3135
"bower": "^1.8.0",
3236
"browser-sync": "^2.18.6",
33-
"del": "^2.2.2",
34-
"gulp": "^3.9.1",
35-
"gulp-batch": "^1.0.5",
3637
"gulp-jscs": "^4.0.0",
3738
"gulp-jshint": "^2.0.4",
38-
"gulp-live-server": "0.0.30",
39-
"gulp-load-plugins": "^1.4.0",
4039
"jshint": "^2.9.4"
4140
}
4241
}

0 commit comments

Comments
 (0)