Skip to content

Commit

Permalink
Configurando json server local e produção
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemjesus committed Aug 1, 2020
1 parent 69f73a0 commit c26eeef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/cadastro/Categoria/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export default () => {
}

useEffect(() => {
const serverUrl = 'http://localhost:3001/categorias';
const serverUrl = window.location.hostname.includes('localhost')
? 'http://localhost:3001/categorias'
: 'https://felipemjesuss-fakeflix.herokuapp.com/categorias';

fetch(serverUrl)
.then(async (response) => {
const responseJson = await response.json();
Expand Down

1 comment on commit c26eeef

@vercel
Copy link

@vercel vercel bot commented on c26eeef Aug 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.