React native project created by expo how to enable http requests to a server on the localhost - laravel

as the title suggests I've used the react native expo quick start guide and managed to setup a basic project. Everything worked just fine until it came to making fetch requests to my local server by laravel 8. It seems both android and ios don't allow making http calls unless you change some config in your android folder which I don't have for using expo. Tried googling for my answer but I keep running into dead ends. Is there any way to enable this or should I try migrating my back-end temporarily to heroku or something similar? Thank you for reading.
Edit: Forgot to mention each time i make a call to the wrong route I immediately get Network error while hitting the right routes throws an unresolved promise

Related

Running an app on Bluemix results in a tunneling socket error

I have added the proxy with an n.p.m installation. However, when I run my app locally it shows this error:
tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 80
What could be the problem? Is it that my added proxy is wrong or is there something else? If it is the former issue, please give me the steps to fix it. Thank you in advance.
I understand you're trying to use the Tradeoff Analytics service. If all you need is a simple proxy, which does not do anything other than forward the \dilemma calls to the service, you might want to consider using the simplified proxy from the new UI's demo page. With this proxy, it's basically a two-liner to set-up a proxy.
To do that, please go to our GitHub project. Here are the steps you need to do in order to use the simple proxy:
Add "http-proxy-middleware": "^0.9.0" to your package.json (this is the only dependency the simplified proxy needs).
Copy the file tradeoff-analytics-proxy.js from our project.
require it in your app.js - see line 20 in the sample app.js
Run it - it will return an Express "middleware" you'll need to send to app.use() - see line 24.
If you're using the Tradeoff Analytics UI Widget, you will need to change the dilemmaServiceUrl to /tradeoff-analytics-proxy/dilemmas. See line 16 of public/index.js.
No need to add a proxy via npm installations. And it definately is the cause for your problem.
It is best to use the app.js provided that essentially acts a proxy for the browser requests to Bluemix

"an error occurred in the application server (Not found)" message in Android app

I've been handed a Genexus KB to make an SD app for it. But each time i want to try it i get a "an error occurred in the application server (Not found)" each time i've ran it in a real device (connected in the internal network thorugh) or in an Android Emulator (Andy).
I've setted the KB to point to a local DB stored in my computer and i've tried different ways to try it and it keeps with no luck.
What else should I do?
PS: when i run the web version of it, there's no problem.
Altight people, first of all thanks for the help you gave me!
Secondly #fpanizza that link you gave me was very useful, I could use CatLog with android emulator Andy (after installing Andy Rootkit) and I found out that my app wasn't reaching REST services in the server which leads me to #Franklin, who was right to let me know that it had to do with REST services and I've found out later that i didn't had installed HTTP Activation at one of the WCF Services at the .Net Framework 4.5 Advanced Services, which allowed to reach REST services, and now it worked.
You can try setting the server URL with the IP of your server.
Is probable that the local host is trying to access itself, the android device.
Service URL property: http://wiki.genexus.com/commwiki/servlet/hwikibypageid?21146
Update
I would do what fpanizza suggests on the comment.
Another troubleshooting idea that may bring some light into problem would be to try to access the rest services from a web navigator on the emulator. The idea would be to validate that the emulator/device can "see" the server. Testing outside the app will help understand if the problem is in the app or the server or the connection device - server.
Thank you #Juan.
For better understanding here I enclose the image.
Control Panel > All Control Panel Items > Programs and Features > Turn Windows features on or off

Laravel won't route on production server

Just getting started with laravel and have run into some trouble.
Before committing to using laravel I wanted to build a very basic web app to test the waters via homestead and then move that web app to a remote server in order to see how easy the process was.
So I've got homestead up and running and have built a very basic web app and it works perfectly locally.
However when I moved the laravel project onto the remote server the routing stopped working.
For example locally testProject.dev/contact takes me through to a mock 'contact us' view. However when I try that on productionServer.com/contact I'm greeted by a 403 'you do not have permission to access contact on this server'.
Am I missing something in laravel here or is this an issue with the sever setup?
Any help would be greatly appreciated. Thanks
Update -> This turned out to be an issue with another piece of software running on the server. Thanks for all the help.

Web API on IIS7.5 Unable to download * from localhost

I'm currently trying to install web api project directly from vs 2013 to my local dev machine, but when I test one of my http get controllers, I get the following:
My url looks like this:
http://localhost:8081/api/Location/States?queryTerm=Ark
When I test this on my local, this url works and I get my json response.
pay no attention to the web config error in the background. If I enter anything invalid, I get an IIS error, so I know I'm hitting the right URL.
Side note: I'm using IE8 for testing.
I found out the solution, and it may be a config thing, but when I made this as an virtual application to a website, this went away, and it gave me a yellow sign of death (which is a good thing). I was able to deduce this to be an oracle issue, where it couldn't find the database connection, and then found out it couldn't resolve tns names.
So I guess Web API can not be hosted by itself on IIS? I haven't looked into it, but it seems this to be the case, unless there needs to be more tweaking involved.
i know too late for response. But i get same error when I try deploy Odata v4 Application in IIS server.
In server , i hit this error as above, i try everything config but nothing change.
At last, i try connect from client and it work.
I recognize that in Client , it download a json file from Server (in case use Odata , it seem like wsdl file in webservice) and API still work well.
For some reason, it cant download in server, but dont worry, it still work.
Hope this helps!

Deploy using IIS Web Deploy (WMSv)c with basic auth fails but NTLM works?

I'm trying to setup Web Deploy on IIS 7, so that 1-click publishing in Visual Studio works.
Every time i try and publish the app i get a 401 error, which seems to be failing to auth against WMSvc. I have set the build output verbosity to detailed and can see the web deploy command being used. When i try and run it from the command prompt i get the same 401 error (ERROR_USER_UNAUTHORIZED), however when i change the the authType parameter in the command from basic to NTLM it works fine and publishes correctly...
As far as i was aware WMSvc only worked with basic auth and not NTLM. As far as my server config goes i have tried setting the management service to accept only windows users and to allow Windows users and management service users, neither setting seems to make any odds.
I can connect fine using IIS manager locally to the remote server, but as soon as i try and use any of the export functionality on the remote server i get permission issues from the remote connection. This all seems most odd, can any one shed some light on this behaviour?
Just providing the answer that worked for me, after searching in vain I stumbled upon an article by Phil Haack (whilst looking for something else entirely):
It turned out I had a URL-ACL defined which was stopping everything from working.
Followed the instructions in that post and it all just worked like it should :-)
I personally wish web deploy was a bit less fragile when it comes to setting it up, works great once you've gone through the pain.

Resources