Skip to content

Commit 09d5d88

Browse files
committed
Upgrade to Create-React-App 2
1 parent 762a626 commit 09d5d88

File tree

3 files changed

+6585
-2528
lines changed

3 files changed

+6585
-2528
lines changed

package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
"version": "0.3.0",
44
"private": true,
55
"dependencies": {
6-
"netlify-lambda": "^0.4.0",
7-
"react": "^16.3.1",
8-
"react-dom": "^16.3.1",
9-
"react-scripts": "1.1.4"
6+
"react": "^16.5.2",
7+
"react-dom": "^16.5.2",
8+
"react-scripts": "2.0.4"
109
},
1110
"scripts": {
1211
"start": "run-p start:**",
@@ -15,18 +14,21 @@
1514
"build": "run-p build:**",
1615
"build:app": "react-scripts build",
1716
"build:lambda": "netlify-lambda build src/lambda",
18-
"test": "react-scripts test --env=jsdom",
17+
"test": "react-scripts test",
1918
"eject": "react-scripts eject"
2019
},
21-
"proxy": {
22-
"/.netlify/functions": {
23-
"target": "http://localhost:9000",
24-
"pathRewrite": {
25-
"^/\\.netlify/functions": ""
26-
}
27-
}
20+
"eslintConfig": {
21+
"extends": "react-app"
2822
},
23+
"browserslist": [
24+
">0.2%",
25+
"not dead",
26+
"not ie <= 11",
27+
"not op_mini all"
28+
],
2929
"devDependencies": {
30-
"npm-run-all": "^4.1.3"
30+
"http-proxy-middleware": "^0.19.0",
31+
"npm-run-all": "^4.1.3",
32+
"netlify-lambda": "^0.4.0"
3133
}
3234
}

src/setupProxy.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const proxy = require('http-proxy-middleware');
2+
3+
module.exports = function(app) {
4+
app.use(proxy('/.netlify/functions/', {
5+
target: 'http://localhost:9000/',
6+
"pathRewrite": {
7+
"^/\\.netlify/functions": ""
8+
}
9+
}));
10+
};

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