Skip to content

Commit

Permalink
fetch data from netlify functions
Browse files Browse the repository at this point in the history
  • Loading branch information
timche committed Apr 27, 2019
1 parent 7b2f2b6 commit c31af6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ class App extends React.Component {
})
}

async fetchData(endpoint, baseUrl = 'https://api.hannoverjs.de/') {
async fetchData(
endpoint,
baseUrl = 'https://hannoverjs.de/.netlify/functions/'
) {
const res = await fetch(`${baseUrl}${endpoint}`)
return camelizeKeys(await res.json(), { deep: true })
}
Expand Down

0 comments on commit c31af6f

Please sign in to comment.