Skip to content

Commit

Permalink
Merge pull request #55 from gabrielduete/feat/use-url-deployed
Browse files Browse the repository at this point in the history
feat: configure api url
  • Loading branch information
gabrielduete authored Jul 22, 2024
2 parents 5f19771 + be5896b commit aa26351
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_URL_API = 'https://sandevistan-backend.onrender.com/'
2 changes: 1 addition & 1 deletion pages/[id].page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const Content = () => {

setIsLoading(true)
try {
const response = await fetch(`http://localhost:8080/${id}`)
const response = await fetch(`${process.env.NEXT_PUBLIC_URL_API}${id}`)

if (!response.ok) {
throw new Error(`COUND NOT GET PAGE ID: ${id}`)
Expand Down
2 changes: 1 addition & 1 deletion src/contexts/ContextPages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const PagesStoregedProvider = ({
const fetchData = async () => {
setIsLoading(true)
try {
const response = await fetch('http://localhost:8080/')
const response = await fetch(`${process.env.NEXT_PUBLIC_URL_API}`)

if (!response.ok) {
throw new Error('Network response was not ok')
Expand Down

0 comments on commit aa26351

Please sign in to comment.