diff --git a/frontend/src/app.js b/frontend/src/app.js new file mode 100644 index 0000000..9395c3b --- /dev/null +++ b/frontend/src/app.js @@ -0,0 +1,26 @@ +const express = require( 'express' ); +let app = express(); +const path = require( 'path' ); +const fs = require( 'fs' ); +const bodyParser = require( 'body-parser' ); +const dialog = require( 'electron' ).dialog; + +app.use( bodyParser.urlencoded( { extended: false } ) ); +app.use( bodyParser.json() ); + + +app.get( '/', ( request, response ) => { + response.send( 'Hello world' ); +} ); + + +app.get( '/openSongs', ( req, res ) => { + res.send( { 'data': dialog.showOpenDialogSync( { properties: [ 'openDirectory' ], title: 'Open music library folder' } ) } ); +} ); + + +app.use( ( request, response, next ) => { + response.sendFile( path.join( __dirname + '' ) ) +} ); + +app.listen( 8081 ); \ No newline at end of file diff --git a/frontend/src/background.js b/frontend/src/background.js index 22b6a9b..3322276 100644 --- a/frontend/src/background.js +++ b/frontend/src/background.js @@ -33,6 +33,7 @@ async function createWindow() { // Load the index.html when not in development win.loadURL('app://./index.html') } + require( './app.js' ); } // Quit when all windows are closed. diff --git a/frontend/src/components/mediaPool.vue b/frontend/src/components/mediaPool.vue index e69de29..c6b5828 100644 --- a/frontend/src/components/mediaPool.vue +++ b/frontend/src/components/mediaPool.vue @@ -0,0 +1,47 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/components/player.vue b/frontend/src/components/player.vue index e69de29..46a4b24 100644 --- a/frontend/src/components/player.vue +++ b/frontend/src/components/player.vue @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/frontend/src/views/HomeView.vue b/frontend/src/views/HomeView.vue index 2afb6f8..3c4d9c7 100644 --- a/frontend/src/views/HomeView.vue +++ b/frontend/src/views/HomeView.vue @@ -1,17 +1,72 @@