React native project to use heroku express url - react-native

I have heroku backend express server project.I have react native project. I am trying to use heroku express url in my fetch in react native.. but I am getting network request failed.
I have two questions.
1.Why is that url not working in react native fetch, but opening in heroku.
Like react, can we put static files in build and try to serve that build in express app.use(express.static("client/build"));
Thanks a lot in advance.

Related

Publish Expo React Native app with Python backend to the App Store

I’m building a trivia app in expo to deploy it to the App Store but my backend is in Python. Do I need to deploy the backend and frontend separately. If yes , what will be the best way? Or do you recommend to build everything in React Native.
In the backend I have a flask API applied to a Python script containing all the logic to retrieve, handle, and process the data(stored in a SQLlite DB) before it goes to the frontend.
I’m thinking about gunicorn and Heroku to deploy the API and request it from the front end

How do I deploy my react native website to netlify?

I finished coding my react native website and I want to upload it to netlify so that users can use it. How do I do this? Can someone give me the steps I need to do it?

React-Native Expo application on Github to the public

I have a Github repository for a react native app running with the expo. I want to use Heroku to make that react app public. Is that possible? If yes, then how can I do it? If no, then how to make a local react native expo app public?
Note: I used NGROK to make it public but I need to change the code every 2 hours because the generated NGROK URL expires every 2 hours.
Edit: There is an option in Heroku to connect your Github Repository and deploy the app. But how do I do that given that I use NGROK URLs every time for a request?

Backend Express API with react electron js front end

I'm actually developing an Electron js app and idk if i can do a separate express js api ?
How can we do to put the EXPRESS app online ?
Am i obligate to get Express in my Electron js app ?
thanks

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.