logicp 6 years ago
parent
commit
2b393f52b4
2 changed files with 4 additions and 3 deletions
  1. 2 1
      package.json
  2. 2 2
      src/form.js

+ 2 - 1
package.json

@@ -34,5 +34,6 @@
     "not dead",
     "not ie <= 11",
     "not op_mini all"
-  ]
+  ],
+  "proxy": "http://localhost:3002"
 }

+ 2 - 2
src/form.js

@@ -107,7 +107,7 @@ class TextFields extends React.Component {
       guest: this.state.significantOther,
     })
 
-    const response = await fetch('http://localhost:3002/attendee', {
+    const response = await fetch('/api/attendee', {
       method: 'post',
       body: body,
       headers: new Headers({
@@ -123,7 +123,7 @@ class TextFields extends React.Component {
 
   fetchAttendees = async () => {
     let attendees
-    await fetch('http://localhost:3002/list', {
+    await fetch('/api/list', {
       method: 'get',
     }).then(data => {
       data.json().then(finalData => {