Skip to content

Commit

Permalink
Change fetch URL inside chart.js file
Browse files Browse the repository at this point in the history
  • Loading branch information
perisicnikola37 committed Jul 29, 2023
1 parent 4c28dda commit d5e59d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion config/cors.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

'allowed_methods' => ['*'],

'allowed_origins' => ['http://localhost:5173', 'https://academix.me', 'https://localhost:5173', '*'],
'allowed_origins' => ['http://localhost:5173', 'https://academix.me', 'https://localhost:5173', '
http://127.0.0.1:8000/admin/api.academix.me/api/chart-data', '
127.0.0.1:8000', '*'],

'allowed_origins_patterns' => [],

Expand Down
2 changes: 1 addition & 1 deletion public/dist/js/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let myChart;
function fetchDataAndRenderChart() {
console.log('fetchDataAndRenderChart function is called.');

fetch('http://127.0.0.1:8000/api/chart-data')
fetch('https://api.academix.me/api/chart-data')
.then(response => response.json())
.then(data => {
console.log('Data received:', data);
Expand Down

0 comments on commit d5e59d1

Please sign in to comment.