React Native Login with Mysql database using fetch. getting : Network request failed error - mysql

so i'm trying to follow this tutorial for Registration : https://reactnativecode.com/react-native-user-registration-example-tutorial/#comment-878
i’m using WampServer on Windows 10. I did as mentioned.
I created a folder called “/react” under “C:\wamp64\www\react” and put the two .php files there .
when i put “localhost/react” in my browser i can see the .php files .
i changed the URL to : ‘http://localhost/react/user_registration.php’
But i’m still getting that error .. i’m not sure what i’m doing wrong here

This happens simply because react-native consider localhost as an URL but it doesn't have a domain :
Solution
On Windows =>
Run [Ctrl] + R
Then type : "cmd", press enter
write "ipconfig" then press enter
a list of IP configurations will show, copy the IP address besides "IPv4 Address", it's under "Ethernet adapter VirtualBox Host-Only Network #2:", it starts with 192.168.xxx.x
on MAC =>
http://osxdaily.com/2010/11/21/find-ip-address-mac/
You will now need to replace the URL with this IP Address
you will have this at the end : ‘http://192.168.xxx.x/react/user_registration.php’
as you've seen, i have replaced localhost to the ip address taken from the CMD [i.e IPV4 Address]
You can also use only free hosting website like Awardspace, 000Webhost to test your app on a real device. Use your local server or this ip address, you can't fetch the data from real device
Hope this will help you!
Franz

Related

SQL not working when I use the network host on my phone or any other device

I am making a web-app currently and I'm using WebStorm for my front and back end. My stack is as follows: Vue3(with axios), Node.js (with Express and Coors as well as mysql and mysql2), and of course, MySQL which I am using a server from AWS.
Below is my code for allowing more than one localhost to connect to the backend Node.js.
const corsOptions = {
origin:["http://localhost:3000", "http://192.168.56.1:3000", "http://10.3.14.231:3000/"]
}
The last 2 in the array are the "Network" links I get when I npm run dev -- --host. I then get this in the terminal:
> Network: http://192.168.56.1:3000/
> Network: http://10.3.14.231:3000/
> Local: http://localhost:3000/
So far, when I type any of the links in network to my phone, it doesn't work for the SQL. The Display and front end pop up just fine, but when I make an account, Firebase will work, but nothing is sent to MySQL.
If there's any questions please ask for clarification. I don't know if this will be an issue when I actually launch it, but I can't find anything else on this problem.

Unable to resolve .local domains with getent even though avahi-resolve-host-name succeeds

Trying to set up a network printer with CUPS.
Followed online documentation that stated:
To discover or share printers using DNS-SD/mDNS, setup .local hostname
resolution with Avahi and restart cups.service.
Followed directions for setting up Avahi to the point where avahi-browse --all --ignore-local --resolve --terminate and avahi-resolve-host-name my-domain.local are both working.
But getent hosts my-domain.local fails to resolve. This results in CUPS failing to print because it can't find my-printer.local.
I read the mdns Github page and saw a note that made me think I didn't need a /etc/mdns.allow file.
nss-mdns has a simple configuration file /etc/mdns.allow for enabling
name lookups via mDNS in other domains than .local.
Note: The "minimal" version of nss-mdns does not read /etc/mdns.allow under any circumstances. It behaves as if the file
does not exist.
In the recommended configuration, no /etc/mdns.allow file is present.
But then I saw the last note in that section:
If, during a request, the system-configured unicast DNS (specified in
/etc/resolv.conf) reports an SOA record for the top-level local name,
the request is rejected. Example: host -t SOA local returns something
other than Host local not found: 3(NXDOMAIN). This is the unicast SOA
heuristic.
I tested that out on my machine and sure enough, I was getting something OTHER than Host local not found....
Adding a /etc/mdns.allow file with a line for .local. and for .local and now I can ping my-printer.local.

Cannot GET /api/forge/oauth/callback

Im trying to test out this demo on my own windows machine: https://github.com/Autodesk-Forge/forge-bim360-clashissue
Ive successfully started had the template running with these commands.
npm install
set FORGE_CLIENT_ID=<<YOUR CLIENT ID FROM DEVELOPER PORTAL>>
set FORGE_CLIENT_SECRET=<<YOUR CLIENT SECRET>>
set FORGE_CALLBACK_URL=<<YOUR CALLBACK URL>>
npm run nodemon
Ive added a new app within the Forge My Apps interface.
Ive added the provisions for the the BIM 360 Account interface.
I can connect to my localhost, and when i press ALLOW to try to authenticate and login to the autodesk account, i get redirected to the following website with the following error:
http://localhost:3000/api/forge/oauth/callback?code=TOAq...
Cannot GET /api/forge/oauth/callback
How can i get past this error?
It looks like a configuration mismatch. You have configured the callback to be http://localhost:3000/api/forge/oauth/callback but according to https://github.com/Autodesk-Forge/forge-bim360-clashissue/blob/master/server/endpoints/oauth.endpoints.js#L72 your server actually expects the callback on a different URL: http://localhost:3000/api/forge/callback/oauth.

Check_mk cannot login - invalid credentials

I've installed omd 2.90-labs-edition. After creating new site I want to login to check_mk (1.2.8.p20) web interface, but the given credentials do not work, I've got "Invalid credentials". This credentials only work for thruk web interface.
Here's output for creating a new site:
Adding /omd/sites/test/tmp to /etc/fstab.
Creating temporary filesystem /omd/sites/test/tmp...OK
Apache port 5000 is in use. I've choosen 5001 instead.
Restarting Apache...OK
Created new site test with version 2.90-labs-edition.
The site can be started with omd start test.
The default web UI is available at https://servername/test/
The admin user for the web applications is omdadmin with password: password
(It can be changed with the 'set_admin_password' command as site user.)
Please do a su - test for administration of this site.
New site is started, but login page for https://server_address/test/check_mk/login.py only gives me "invalid credentials" after login to "omdadmin" user.
Can't find the reason why... no information in logs /omd/sites/test/var/log/apache/error_log
Unfortunately tip about changing initial credentials for omdadmin user from https://mathias-kettner.com/check_mk-werks.php?werk_id=7643&__hstc=14126696.95407ad675cb255879d5c9f0e7607474.1553259391987.1553519829997.1553598167959.3&__hssc=14126696.1.1553598167959&__hsfp=3878063914 doesn't work for me or I do something wrong...
How to login to check_mk webinterface? Any suggestions appreciated.
The solutions was to turn off thruk_cookie_auth (omd config -> Web GUI).
yes #gaspar,
It also worked for me with the following config param on
OMS labs 2.90 (Check_MK + pnp4nagios + Thruk + grafana + InfluxDB)
APACHE_MODE: ssl
APACHE_TCP_ADDR: 127.0.0.1
APACHE_TCP_PORT: 5000
AUTOSTART: on
CORE: nagios
CRONTAB: on
DATASCRYER: off
DEFAULT_GUI: check_mk
DOKUWIKI_AUTH: off
DOWNTIMEAPI: off
GEARMAND: on
GEARMAND_PORT: 127.0.0.1:4730
GEARMAN_NEB: on
GEARMAN_WORKER: on
GRAFANA: on
GRAFANA_TCP_PORT: 8003
INFLUXDB: on
INFLUXDB_HTTP_TCP_PORT: 127.0.0.1:8086
INFLUXDB_META_TCP_PORT: 8088
INFLUXDB_MODE: http
INFLUXDB_RETENTION: 104
LIVESTATUS_TCP: off
MKEVENTD: off
MOD_GEARMAN: on
MULTISITE_AUTHORISATION: on
MULTISITE_COOKIE_AUTH: off
MYSQL: off
NAGFLUX: on
NAGIOS_THEME: classicui
NAGVIS_URLS: check_mk
NSCA: off
PNP4NAGIOS: gearman
PROMETHEUS: off
SNMPTRAPD: off
THRUK_COOKIE_AUTH: off
TMPFS: on
WEB_ALIAS:
WEB_REDIRECT: off

Configure phpstorm for sourceforge as remote server

I'm looking for configure my IDE phpstorm for connect to sourgeforge who contains my code. But I had a problem.
In window setting, Phpstorm ask me some informations :
Type of connexion (FTP/SFTP/FTPS) : I set SFTP
SFTP host : I set "mysourgeforgepseudo#frs.sourceforge.net"
Ports : 22 (automatically filled)
=> There is a button "Test SFTP connections..". When I push it, a popin notices me 'Successfully connected to "mysourgeforgepseudo#frs.sourceforge.net' ". So..its okay !
After..
Root path : /home/users/a/b/mysourgeforgepseudo/ (automatically filled)
Username : mysourgeforgepseudo
Auth type (Password or Key pair OpenSSH) : I set "Password"
Password : password in sourceforge..
And now, there is a field "Web server root URL". So, I set this line : (but maybe Im wrong ?) "https://mysourgeforgepseudo#git.code.sf.net/p/myproject/code"
When I click to the button "Next", Phpstorm check if settings are OK, but no..I get this message : "Connection to 'sourceforge' failed.
HEAD method failed for "https://mysourgeforgepseudo#git.code.sf.net/p/myproject/code" with HTTP status 401."
I don't understand..When I enter this url in my browser, I get a empty page (So, there is a problem!). But I get this URL from my personal space of the sourceforge webdite..Where is(are?) the mistake(s?) ?
PHPstorm tries to reach your webserver with HEAD request, just to check response code. It gets 401, that is access denied. So once you set up webserver URL that works (response code 200) you'll be able to proceed.
In your particular case, it seems that you are trying to logi without password, which is unlikely to work.