complete except for drag&drop queue reordering and sorting
This commit is contained in:
parent
63dec0ede2
commit
ccbb7fcd13
5 changed files with 532 additions and 17 deletions
|
|
@ -1,12 +1,11 @@
|
|||
import { SpotifyWS } from "./spotify.ts"
|
||||
import { HeartbeatWS } from "./heartbeat.ts";
|
||||
import { PlayerManager } from "./playerManager.ts";
|
||||
import { serveFile } from "@std/http/file-server";
|
||||
import { serveDir } from "@std/http/file-server";
|
||||
import { UserWS } from "./user.ts";
|
||||
|
||||
const USER_PATTERN = new URLPattern({pathname: "/ws/user"})
|
||||
const SPOTIFY_PATTERN = new URLPattern({pathname: "/ws/spotify"})
|
||||
const song = "spotify:track:2VxJVGiTsK6UyrxPJJ2lR9";
|
||||
|
||||
function commonWs(req: Request) {
|
||||
const { socket, response } = Deno.upgradeWebSocket(req);
|
||||
|
|
@ -33,11 +32,11 @@ Deno.serve((req) => {
|
|||
const spState = spotify?.ws.readyState;
|
||||
if (spState !== undefined && spState !== WebSocket.CLOSED) spotify?.ws.close();
|
||||
|
||||
spotify = new SpotifyWS(socket, () => song);
|
||||
new SpotifyWS(socket);
|
||||
new HeartbeatWS(socket);
|
||||
|
||||
return response
|
||||
}
|
||||
|
||||
return serveFile(req, "./static/index.html")
|
||||
return serveDir(req, {fsRoot: "./static", urlRoot: ""})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue