Reputation: 23
Once every few refreshes of the page I get error 500 which does not allow me to get data from the Laravel API. This response:
{ "message": "Server Error" }{ "message": "Server Error" }
web.php
Route::get('/product/{product}/details', 'ShopController@getProductDetails');
header request
headers: {
"X-CSRF-TOKEN": document.querySelector('meta[name="csrf-token"]').getAttribute('content')
},
axios
axios.get(this.$apiClient + '/product/' + this.itemprop + '/details', this.headers)
.then(response => {
//some code
});
Upvotes: 1
Views: 3023
Reputation: 33
I had that issue too. In log file, sometimes it appears.
Access denied for user 'forge'@'localhost' (using password: NO)
To fix this, cache the config or change the default value of database and username at config/database.php
.
Upvotes: 1