add nix flakes

This commit is contained in:
2025-03-02 18:54:17 -08:00
parent 647ee74bf6
commit 29ce0863ca
4 changed files with 266 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
import express from "express";
import expressWs from "express-ws";
import path from "path";
import { MediaPlayer } from "./MediaPlayer";
import { searchInvidious, fetchThumbnail } from "./InvidiousAPI";
import { PlaylistItem } from './types';
@@ -158,14 +159,14 @@ apiRouter.delete("/favorites", withErrorHandling(async (req, res) => {
}));
// Serve static files for React app (after building)
app.use(express.static("dist/frontend"));
app.use(express.static(path.join(__dirname, "../dist/frontend")));
// Mount API routes under /api
app.use("/api", apiRouter);
// Serve React app for all other routes (client-side routing)
app.get("*", (req, res) => {
res.sendFile("dist/frontend/index.html", { root: "." });
res.sendFile(path.join(__dirname, "../dist/frontend/index.html"));
});
const port = process.env.PORT || 3000;