From df6e425f9f38a4445b12fb6300fc67de4fe9eeda Mon Sep 17 00:00:00 2001 From: DavidWells Date: Mon, 7 Jan 2019 12:50:01 -0800 Subject: [PATCH] update all the deps Fix #2 --- package.json | 29 ++++++++++++++--------------- src/App.js | 2 +- src/setupProxy.js | 12 ++++++++++++ 3 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 src/setupProxy.js diff --git a/package.json b/package.json index 32d5dd8..dfcaa98 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "0.1.0", "private": true, "dependencies": { - "faunadb": "^0.2.2", - "react": "^16.4.0", - "react-dom": "^16.4.0", - "react-scripts": "1.1.4" + "faunadb": "^2.5.2", + "react": "^16.7.0", + "react-dom": "^16.7.0", + "react-scripts": "2.1.3" }, "scripts": { "bootstrap": "node ./scripts/bootstrap-fauna-database.js", @@ -22,16 +22,15 @@ "test": "react-scripts test --env=jsdom" }, "devDependencies": { - "markdown-magic": "^0.1.23", - "netlify-lambda": "^0.4.0", - "npm-run-all": "^4.1.3" + "http-proxy-middleware": "^0.19.1", + "markdown-magic": "^0.1.25", + "netlify-lambda": "^1.1.1", + "npm-run-all": "^4.1.5" }, - "proxy": { - "/.netlify/functions": { - "target": "http://localhost:9000", - "pathRewrite": { - "^/\\.netlify/functions": "" - } - } - } + "browserslist": [ + ">0.2%", + "not dead", + "not ie <= 11", + "not op_mini all" + ] } diff --git a/src/App.js b/src/App.js index 7cd61fc..da51874 100644 --- a/src/App.js +++ b/src/App.js @@ -324,5 +324,5 @@ function getTodoId(todo) { if (!todo.ref) { return null } - return todo.ref['@ref'].split('/').pop() + return todo.ref['@ref'].id } diff --git a/src/setupProxy.js b/src/setupProxy.js new file mode 100644 index 0000000..e569002 --- /dev/null +++ b/src/setupProxy.js @@ -0,0 +1,12 @@ +const proxy = require('http-proxy-middleware'); + +module.exports = function(app) { + app.use( + proxy('/.netlify/functions/', { + target: 'http://localhost:9000/', + pathRewrite: { + '^/\\.netlify/functions': '' + } + }) + ); +}; \ No newline at end of file