Add the cors module and use it with express api

This commit is contained in:
mjokfox
2024-05-14 12:53:39 +02:00
committed by Rick van Lieshout
parent 6e43cbb4d7
commit 180d9c97a7
2 changed files with 5 additions and 1 deletions

View File

@@ -5,12 +5,14 @@ import { settingsStore } from "../../scripts/settings";
import { addCurrentInfo } from "./features/current";
import { addPlaybackControl } from "./features/player";
import { addLegacyApi } from "./legacy";
import cors from "cors";
/**
* Function to enable TIDAL Hi-Fi's express api
*/
export const startApi = (mainWindow: BrowserWindow) => {
const expressApp = express();
expressApp.use(cors());
expressApp.get("/", (req, res) => res.send("Hello World!"));
// add features