can play music and authenticate
This commit is contained in:
parent
bd06b5fe21
commit
451fb433eb
2 changed files with 20 additions and 5 deletions
|
@ -41,7 +41,7 @@ var app = new Vue({
|
||||||
document.addEventListener('musickitloaded', function() {
|
document.addEventListener('musickitloaded', function() {
|
||||||
// MusicKit global is now defined
|
// MusicKit global is now defined
|
||||||
MusicKit.configure({
|
MusicKit.configure({
|
||||||
developerToken: '',
|
developerToken: 'put key here pls',
|
||||||
app: {
|
app: {
|
||||||
name: 'My Cool Web App',
|
name: 'My Cool Web App',
|
||||||
build: '1978.4.1'
|
build: '1978.4.1'
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
const {app, BrowserWindow, ipcMain} = require("electron")
|
const {app, BrowserWindow, ipcMain} = require("electron")
|
||||||
const {join, resolve} = require("path")
|
const {join, resolve} = require("path")
|
||||||
|
const getPort = require("get-port");
|
||||||
|
const express = require("express");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
const CiderWin = {
|
const CiderWin = {
|
||||||
CreateBrowserWindow() {
|
CreateBrowserWindow() {
|
||||||
|
@ -16,26 +19,38 @@ const CiderWin = {
|
||||||
plugins: true,
|
plugins: true,
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
nodeIntegrationInWorker: false,
|
nodeIntegrationInWorker: false,
|
||||||
webSecurity: true,
|
webSecurity: false,
|
||||||
allowRunningInsecureContent: true,
|
allowRunningInsecureContent: true,
|
||||||
enableRemoteModule: true,
|
enableRemoteModule: true,
|
||||||
sandbox: true,
|
sandbox: true,
|
||||||
nativeWindowOpen: true
|
nativeWindowOpen: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
CiderWin.InitWebServer()
|
||||||
if (process.platform === "darwin" || process.platform === "linux") {
|
if (process.platform === "darwin" || process.platform === "linux") {
|
||||||
win = new BrowserWindow(options)
|
win = new BrowserWindow(options)
|
||||||
} else {
|
} else {
|
||||||
const {BrowserWindow} = require("electron-acrylic-window");
|
const {BrowserWindow} = require("electron-acrylic-window");
|
||||||
win = new BrowserWindow(options)
|
win = new BrowserWindow(options)
|
||||||
}
|
}
|
||||||
let location = join(__dirname, "../cider-ui-tests/index.html")
|
|
||||||
win.loadFile(location)
|
let location = "http://localhost:9000/"
|
||||||
|
win.loadURL(location)
|
||||||
win.on("closed", () => {
|
win.on("closed", () => {
|
||||||
win = null
|
win = null
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
SetupHandlers() {
|
async InitWebServer() {
|
||||||
|
const webRemotePort = await getPort({port : 9000});
|
||||||
|
const webapp = express();
|
||||||
|
const webRemotePath = path.join(__dirname, '../cider-ui-tests/');
|
||||||
|
webapp.use(express.static(webRemotePath));
|
||||||
|
webapp.get('/', function (req, res) {
|
||||||
|
res.sendFile(path.join(webRemotePath, 'index.html'));
|
||||||
|
});
|
||||||
|
webapp.listen(webRemotePort, function () {
|
||||||
|
console.log(`Web Remote listening on port ${webRemotePort}`);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue