Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoOMaia committed Nov 26, 2023
1 parent a8e9f6a commit a457e38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Rest_API/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pandas as pd

app = Flask(__name__)
CORS(app, origins="*")
CORS(app)

RULES_PATH = "/app/models/rules.pkl"
FREK_PATH = "/app/models/freq.pkl"
Expand Down
7 changes: 2 additions & 5 deletions Rest_API/static/scripts.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
const url_songs = 'http://10.102.75.219:32196/api/songs';
const url_recommend = 'http://10.102.75.219:32196/api/recommend';

let allSongsList = []; // Initialize as an empty array

// Fetch songs from the API
fetch(url_songs)
fetch('http://localhost:32196/api/songs')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
Expand Down Expand Up @@ -113,7 +110,7 @@ function displayRecommendations(recommendations) {
// Event listener for Find Playlist button
document.getElementById("findPlaylistBtn").addEventListener("click", async () => {
try {
const response = await fetch(url_recommend, {
const response = await fetch('http://localhost:32196/api/recommend', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down

0 comments on commit a457e38

Please sign in to comment.