Skip to content

Commit d08f40e

Browse files
chqy24gondzo
authored andcommitted
f2f challenge 30056013
1 parent 7dbee71 commit d08f40e

File tree

18 files changed

+96
-17
lines changed

18 files changed

+96
-17
lines changed

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: npm run start

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,24 @@ See Guild https://github.com/lorenwest/node-config/wiki/Configuration-Files
3434
|`lint:fix`|Lint and fix all `.js` files. [Read more on this](http://eslint.org/docs/user-guide/command-line-interface.html#fix).|
3535
|`test`|Run tests using [mocha-webpack](https://github.com/webpack/mocha-loader) for all `*.spec.(js|jsx)` files in the `src` dir.|
3636

37+
## Local deploy
38+
NODE_ENV=production npm run build
39+
NODE_ENV=production npm run start
40+
41+
## Heroku deploy
42+
43+
### Prerequisites
44+
- Heroku CLI
45+
46+
### set up
47+
npm run heroku:[ENV]:init
48+
npm run heroku:[ENV]:deploy
49+
50+
### update
51+
npm run heroku:[ENV]:deploy
52+
53+
`npm run heroku:[ENV]:init` will create a new git remote in current git repository and a new app in remote server.
54+
55+
`npm run heroku:[ENV]:deploy` line will push current branch to corresponding remote environment.
56+
57+
`ENV` can be 'prod', 'dev', 'staging', 'test'.

config/development.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable import/no-commonjs */
2+
/**
3+
* Main config file
4+
*/
5+
module.exports = {
6+
// below env variables are NOT visible in frontend
7+
PORT: process.env.PORT || 3000,
8+
9+
// below env variables are visible in frontend
10+
GOOGLE_API_KEY: process.env.GOOGLE_API_KEY || 'AIzaSyCrL-O319wNJK8kk8J_JAYsWgu6yo5YsDI',
11+
API_BASE_PATH: process.env.API_BASE_PATH || 'https://kb-dsp-server-dev.herokuapp.com',
12+
};

config/production.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable import/no-commonjs */
2+
/**
3+
* config file for production environment
4+
*/
5+
module.exports = {
6+
// below env variables are NOT visible in frontend
7+
PORT: process.env.PORT || 3000,
8+
9+
// below env variables are visible in frontend
10+
GOOGLE_API_KEY: process.env.GOOGLE_API_KEY || 'AIzaSyCrL-O319wNJK8kk8J_JAYsWgu6yo5YsDI',
11+
API_BASE_PATH: process.env.API_BASE_PATH || 'https://kb-dsp-server-dev.herokuapp.com',
12+
};

config/staging.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable import/no-commonjs */
2+
/**
3+
* Main config file
4+
*/
5+
module.exports = {
6+
// below env variables are NOT visible in frontend
7+
PORT: process.env.PORT || 3000,
8+
9+
// below env variables are visible in frontend
10+
GOOGLE_API_KEY: process.env.GOOGLE_API_KEY || 'AIzaSyCrL-O319wNJK8kk8J_JAYsWgu6yo5YsDI',
11+
API_BASE_PATH: process.env.API_BASE_PATH || 'https://kb-dsp-server-dev.herokuapp.com',
12+
};

config/test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/* eslint-disable import/no-commonjs */
2+
/**
3+
* Main config file
4+
*/
5+
module.exports = {
6+
// below env variables are NOT visible in frontend
7+
PORT: process.env.PORT || 3000,
8+
9+
// below env variables are visible in frontend
10+
GOOGLE_API_KEY: process.env.GOOGLE_API_KEY || 'AIzaSyCrL-O319wNJK8kk8J_JAYsWgu6yo5YsDI',
11+
API_BASE_PATH: process.env.API_BASE_PATH || 'https://kb-dsp-server-dev.herokuapp.com',
12+
};

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@
55
"main": "index.js",
66
"scripts": {
77
"dev": "cross-env NODE_ENV=development nodemon server",
8-
"start": "cross-env NODE_ENV=production node server",
9-
"build": "cross-env NODE_ENV=production webpack --bail --progress --build --tc",
8+
"start": "node --max-old-space-size=512 server",
9+
"build": "node --max-old-space-size=512 ./node_modules/webpack/bin/webpack --bail --progress --build --tc",
1010
"lint": "eslint --ext jsx --ext js .",
1111
"lint:fix": "npm run lint -- --fix",
12-
"test": "mocha-webpack --require setup-test.js --webpack-config webpack.config-test.js \"src/**/*.spec.(jsx|js)\""
12+
"test": "mocha-webpack --require setup-test.js --webpack-config webpack.config-test.js \"src/**/*.spec.(jsx|js)\"",
13+
"postinstall":"npm run build",
14+
"heroku:prod:init":"git remote remove production && heroku create --remote production && heroku config:set NODE_ENV=production --remote production",
15+
"heroku:dev:init": "git remote remove dev && heroku create --remote dev && heroku config:set NODE_ENV=development NPM_CONFIG_PRODUCTION=false --remote dev",
16+
"heroku:staging:init": "git remote remove staging && heroku create --remote staging && heroku config:set NODE_ENV=staging --remote staging",
17+
"heroku:test:init": "git remote remove test && heroku create --remote test && heroku config:set NODE_ENV=test --remote test",
18+
"heroku:prod:deploy":"git push production master",
19+
"heroku:dev:deploy":"git push dev master",
20+
"heroku:staging:deploy":"git push staging master",
21+
"heroku:test:deploy":"git push test master"
1322
},
1423
"author": "",
1524
"license": "MIT",

src/components/Header/Header.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { PropTypes } from 'react';
22
import CSSModules from 'react-css-modules';
33
import { Link } from 'react-router';
4-
import LogInModalContainer from 'routes/Home/containers/LogInModalContainer';
4+
import LogInModalContainer from 'routes/Home/containers/LoginModalContainer';
55
import SignupModalContainer from 'routes/Home/containers/SignupModalContainer';
66
import SearchInput from '../SearchInput';
77
import Dropdown from '../Dropdown';

src/routes/DroneDetails/components/DroneScheduleTable/DroneScheduleTable.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { PropTypes } from 'react';
22
import CSSModules from 'react-css-modules';
3-
import Reactable from 'Reactable';
3+
import Reactable from 'reactable';
44
import styles from './DroneScheduleTable.scss';
55

66
const Table = Reactable.Table;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import feedbackItem from './feedbackItem';
1+
import FeedbackItem from './FeedbackItem';
22

3-
export default feedbackItem;
3+
export default FeedbackItem;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy