I am struggling to access my Laravel API on the production server. The development server (localhost) works fine. On my localhost, I am using:
curl -X POST -d
'{"email":"testuser@domain.com","password":"password"}'
http://localhost:8888/api/auth
Which correctly returns:
{"status":"true","request":"postAuth"}
Route:
Route::post('api/auth', 'APIController@authUser');
When I try to access this API on the actual website (using https://), it returns the full error page of 'whoops, this page cannot be found':
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="robots" content="noindex,nofollow" />
<style> etc...
I have an SSL certificate also installed through Laravel Forge, so if I use http://
, it returns:
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
Why can I access the API on localhost but not on the production server? Any help would be hugely appreciated. I think I've added all the code, but if you require any other parts, please let me know.