APIs from Next.js App work locally but produce errors when deployed to Netlify - api

The image attached shows the error I get when deploying my NextJS App APIs to Netlify. Locally, they all work well

On Netlify, I forgot to add the API key to my environment variable. Immediately after adding it, everything worked smoothly

Related

how to make ArcGis(4.18) map offline and to consume it in angular application

how to make ArcGis(4.18) map offline and to consume it in angular application
tried deploying arc-gis JavaScript API and SDK
and replaced url"https://js.arcgis.com/" with "http://127.0.0.1/arcgis_js_api/library/"
still not working
The download api comes with a test page, did you try it and work fine?

Json-server how to set a custom URL for the api

I am working on an app and used json-server for the backend api. I published the app using github pages and everything seemed to be working fine on my laptop. But when I try to open the app on another device, it does not work. I realized this was because I am using localhost:3001 as the resource for my api, and this only exists on my laptop. I am now trying to change the resource from localhost:3001 to a custom url 'https://my-json-server.typicode.com/vbrambila2/1RM/movements'. The issue I'm running into now is that the POST, PATCH, and DELETE methods in my actions aren't updating the api anymore. Anyone know what I might be doing wrong?

What is the best way to handle the use of staging or production API root url in a React Native app?

Say I have a staging API url and a production API url. What is the best way to setup the app to use the production API url when I want to release a build to the stores and the staging API url when I am running in debug mode and just uploading to TestFlight/Internal Beta?
I was looking at react-native-config but it seems quite daunting to configure. Would using the DEV variable be possible/practical?
Thanks in advance.

Impossible to use proxy

I'm trying to use proxy with my react-native app (build with CRNA and Expo).
So in my package.json file I put : "proxy": "192.168.1.27:8080" and then make simple get request with fetch with the/users` path and react call me network error (he don't see the proxy param, just /users when I'm debugging).
The fetch request work well if I put the full url.
In react (for website) I do the same thing and that's work to.
Thank's for your help.
In Reactjs proxies are mainly used to avoid cors issues. Since React Native connects to iOS & Android natively, there is no browser issue so you don't need a proxy.
The approach I use is to call http:127.0.0.1:nnnn/api/route (not localhost) in the React Native app when testing the backend, and the deployed url in production. So you can deploy your server separately and reach it directly in the app.

page refresh not working while using https

we have built UI using react js framework and html +css + js code is deployed inside apache 2. When I browse website it works fine but if I refresh page then I get 404. Can someone tell me how can I fix it.
Perhaps this answer is relevant to you:
Apache web server doesn't allow me to refresh on /about but on localhost its working fine
I know I also had problems related to HTML5 mode when first setting up react-router.
If you are using React-Router you are probably having this problem: React-router urls don't work when refreshing or writting manually.
You can also see the React Router tutorial for how to set up a production Express server.