Skip to content

Commit 90a4fbf

Browse files
committed
added another proxy rule
1 parent 15a28a9 commit 90a4fbf

File tree

5 files changed

+30
-2
lines changed

5 files changed

+30
-2
lines changed

server/client/package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/client/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,21 @@
55
"proxy": {
66
"/auth/google": {
77
"target": "http://localhost:5000"
8+
},
9+
"/api/*": {
10+
"target": "http://localhost:5000"
811
}
912
},
1013
"dependencies": {
14+
"axios": "^0.16.2",
1115
"materialize-css": "^0.99.0",
1216
"react": "^15.6.1",
1317
"react-dom": "^15.6.1",
1418
"react-redux": "^5.0.5",
1519
"react-router-dom": "^4.1.1",
1620
"react-scripts": "1.0.10",
17-
"redux": "^3.7.1"
21+
"redux": "^3.7.1",
22+
"redux-thunk": "^2.2.0"
1823
},
1924
"scripts": {
2025
"start": "react-scripts start",

server/client/src/actions/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import axios from 'axios';
2+
import { FETCH_USER } from './types';
3+
4+
const fetchUser = () => {
5+
axios.get('/api/current_user');
6+
};

server/client/src/actions/types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const FETCH_USER = 'fetch_user';

server/client/src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import React from 'react';
33
import ReactDOM from 'react-dom';
44
import { Provider } from 'react-redux';
55
import { createStore, applyMiddleware } from 'redux';
6+
import reduxThunk from 'redux-thunk';
67

78
import App from './components/App';
89
import reducers from './reducers';
910

10-
const store = createStore(reducers, {}, applyMiddleware());
11+
const store = createStore(reducers, {}, applyMiddleware(reduxThunk));
1112

1213
ReactDOM.render(
1314
<Provider store={store}><App /></Provider>,

0 commit comments

Comments
 (0)