diff --git a/api/index.js b/api/index.js index 5f7f93d..fdf3bc2 100644 --- a/api/index.js +++ b/api/index.js @@ -17,7 +17,7 @@ app.use(function(req, res, next) { }); app.get('/', (req, res) => res.send('Jobs API!')); -app.get('/jobs', async (req, res) => { +app.get('/api/jobs', async (req, res) => { const jobs = await getAsync('github'); return res.send(jobs); }); diff --git a/client/package.json b/client/package.json index 5a69a79..8e7f12c 100644 --- a/client/package.json +++ b/client/package.json @@ -21,6 +21,7 @@ "eslintConfig": { "extends": "react-app" }, + "proxy": "http://localhost:5000", "browserslist": { "production": [ ">0.2%", @@ -33,4 +34,4 @@ "last 1 safari version" ] } -} +} \ No newline at end of file diff --git a/client/src/App.js b/client/src/App.js index 7ad9c70..4f30d81 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -3,7 +3,7 @@ import './App.css'; import Jobs from './Jobs'; -const JOB_API_URL = 'http://localhost:5000/jobs'; +const JOB_API_URL = '/api/jobs'; const fetchJobs = async updateCb => { const res = await fetch(JOB_API_URL);