Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image fetch #397

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import getPlaylist from "./routes/getPlaylist.js";
import getPlaylistById from "./routes/getPlaylistById.js";
import getArtists from "./routes/getArtists.js";
import getArtistsById from "./routes/getArtistById.js";
import cron from "node-cron";
import axios from "axios";
import admin from "firebase-admin"
import{fetchDataAndStore} from "./routes/scheduler.js"
import getTopArtists from "./routes/getTopArtists.js"

const app = express();
const PORT = 3030;
Expand Down Expand Up @@ -45,15 +42,9 @@ app.use("/search/artists", getArtists);
//get artist by id
app.use("/search/artist", getArtistsById);

app.get('/putData', async (req, res) => {
try {
await fetchDataAndStore();
res.status(200).json({ message: "Data is sent successfully" });
} catch (error) {
console.error('Error in fetching data', error);
res.status(500).json({ error: 'Internal Server Error' });
}
});
//get top artists
app.use("/top-artists", getTopArtists);


app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
Expand Down
Loading
Loading