-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Refactored test codes - Added a webpack.prod.config.js
- Loading branch information
Benny Ogidan
authored and
Benny Ogidan
committed
Oct 27, 2017
1 parent
62fd9d4
commit 35fb9ad
Showing
26 changed files
with
471 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
JWT_SECRET=sampleJWT | ||
DBUSERNAME=sampledb | ||
DBPASSWORD=password | ||
DB=sampledb | ||
DBADDRESS=SampleIpaddress | ||
DBDIALECT=Sampledialect | ||
TESTDB=sampletestdb | ||
ISBNRANDOM_MIN_ID =test_random_id | ||
ISBNRANDOM_MAX_ID=test_random_id | ||
DATABASE_URL=databaseurl | ||
NODE_ENV=environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,49 @@ | ||
{ | ||
"root": true, | ||
"extends": "airbnb-base", | ||
"env": { | ||
"node": true, | ||
"es6": true, | ||
"mocha": true | ||
}, | ||
"rules": { | ||
"one-var": 0, | ||
"one-var-declaration-per-line": 0, | ||
"new-cap": 0, | ||
"consistent-return": 0, | ||
"no-param-reassign": 0, | ||
"comma-dangle": 0, | ||
"curly": ["error", "multi-line"], | ||
"prefer-destructuring": ["error", {"object": false,"array": false}], | ||
"import/no-unresolved": [2, { "commonjs": true }], | ||
"no-shadow": ["error", { "allow": ["req", "res", "err"] }], | ||
"valid-jsdoc": ["error", { | ||
"requireReturn": true, | ||
"requireReturnType": true, | ||
"requireParamDescription": false, | ||
"requireReturnDescription": true | ||
}], | ||
"require-jsdoc": ["error", { | ||
"require": { | ||
"FunctionDeclaration": true, | ||
"MethodDefinition": true, | ||
"ClassDeclaration": true | ||
} | ||
}] | ||
} | ||
"root": true, | ||
"extends": "airbnb-base", | ||
"env": { | ||
"browser": true, | ||
"jquery": true, | ||
"node": true, | ||
"es6": true, | ||
"mocha": true | ||
}, | ||
"globals": { | ||
"describe": true, | ||
"expect": true | ||
}, | ||
"rules": { | ||
"one-var": 0, | ||
"one-var-declaration-per-line": 0, | ||
"new-cap": 0, | ||
"consistent-return": 0, | ||
"no-param-reassign": 0, | ||
"comma-dangle": 0, | ||
"curly": [ "error", "multi-line" ], | ||
"prefer-destructuring": [ "error", { "object": false, "array": false } ], | ||
"import/no-unresolved": [ 2, { "commonjs": true } ], | ||
"no-shadow": [ "error", { "allow": [ "req", "res", "err" ] } ], | ||
"valid-jsdoc": [ | ||
"error", | ||
{ | ||
"requireReturn": true, | ||
"requireReturnType": true, | ||
"requireParamDescription": false, | ||
"requireReturnDescription": true | ||
} | ||
], | ||
"require-jsdoc": [ | ||
"error", | ||
{ | ||
"require": { | ||
"FunctionDeclaration": true, | ||
"MethodDefinition": true, | ||
"ClassDeclaration": true | ||
} | ||
} | ||
] | ||
}, | ||
"settings": { | ||
"import/resolver": "node" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
web: node ./server/dist/bin/www.js | ||
web: npm run start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import configDev from './configStore.dev'; | ||
import configProd from './configStore.prod'; | ||
|
||
if (process.env.NODE_ENV === 'production') { | ||
module.exports = configProd; | ||
} else { | ||
module.exports = configDev; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import jwtdecode from 'jwt-decode'; | ||
import throttle from 'lodash/throttle'; | ||
|
||
import { createStore, applyMiddleware } from 'redux'; | ||
import thunk from 'redux-thunk'; | ||
import setAuthorizationToken from '../utils/setAuthorizationToken'; | ||
import { setCurrentUser } from '../actions/auth'; | ||
import rootReducer from '../reducers/rootReducers'; | ||
import { saveState } from '../utils/Localsave'; | ||
|
||
const initialState = {}; | ||
const store = createStore( | ||
rootReducer, | ||
initialState, | ||
(applyMiddleware(thunk)) | ||
); | ||
|
||
|
||
if (localStorage.token) { | ||
setAuthorizationToken(localStorage.token); | ||
store.dispatch(setCurrentUser(jwtdecode(localStorage.token))); | ||
} | ||
|
||
store.subscribe(throttle(() => { | ||
saveState(store.getState()); | ||
}), 1000); | ||
|
||
|
||
export default store; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.