-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
31 lines (25 loc) · 930 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// const express = require('express');
// const app = express();
// const port = 3333;
// const cors = require('cors');
// let ip = require('ip');
// const ytdl = require('ytdl-core');
// require('dotenv').config();
// const redirect_url = process.env.NEXT_PUBLIC_BACKEND_REDIRECT_URL;
// const SpotifyClientId = process.env.NEXT_PUBLIC_SPOTIFY_CLIENTID;
// const SpotyfyClientSecret = process.env.NEXT_PUBLIC_SPOTIFY_CLIENTSECRET;
// app.use(cors());
// app.use(express.json());
// app.use(express.urlencoded({ extended: false }));
// app.get('/', (rq, rs) => {
// rs.send("Backend root");
// console.log(rs.connection.remoteAddress);
// });
// app.get('/get_video', (rq, rs) => {
// const id = rq.query.id;
// ytdl(`https://youtube.com/watch?v=${id}`, { filter: 'audioonly', quality: 'highestaudio' })
// .pipe(rs);
// })
// app.listen(port, e => {
// console.log(`Server is running on port ${port}`);
// });