Files
NotPlexApp/preload.js

7 lines
323 B
JavaScript

const { contextBridge } = require('electron');
contextBridge.exposeInMainWorld('api', {
getMovies: () => fetch('http://localhost:8000/movies').then(r => r.json()),
getMovieDetails: (id) => fetch(`http://localhost:8000/movies/${id}`).then(r => r.json()),
getStreamUrl: (id) => `http://localhost:8000/stream/${id}`
});