My idea is that im implementing using JS in client a pacman game. So i want to make a api rest code, so from client i can login with username and password, get user statistic ( total games played, total games won, total lost…), top ten players, player or user config and logout…
So if i develop in home i got CORS error ( localhost)
So the first steps would be run the app
Test-db i want to test if connection to database is ok or is falling/connection cant be done…
Thanks in advance also if you want to see the code:
Note i need this for educational purpose and would be nice that someone can help me, because with my students we are stuck in getting api work because of CORS error. So i need to connect to the api some kind fetch(“…/v1/login”)
Also, if you are making requests to the hosted API from your local machine, you will encounter a CORS error. This behavior is intentional and cannot be removed:
Now i have changed .htaccess and seems to work, dont know exactly what i die:
# Evita el acceso a archivos sensibles
<Files .env>
Order allow,deny
Deny from all
</Files>
# Redirección de URLs amigables
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
So my idea was to contact from github/vercel to infinityFree from a form like and inside the submit code, include a fetch instruction with user and password…and get the response in the web
Is there any way i can do it ? In vite/vercel i have a pacman game implemented in js/html and i want from there to get info from last games, my profile, top 10 players… all information come from infinityfree codeigniter and mysql database..
No, as I already mentioned, you cannot send requests to your website from outside it. This means the form on GitHub or Vercel won’t work because it won’t be able to send a request to your InfinityFree hosted site to be able to fetch the information.