Skip to content

Commit

Permalink
Merge pull request #7 from chourmovs/beta
Browse files Browse the repository at this point in the history
7
  • Loading branch information
chourmovs authored Sep 1, 2024
2 parents 1181413 + 3696a7e commit 9c9c5b2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
24 changes: 18 additions & 6 deletions webapp/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ const path = require('path');
const sftpUpload = require('sftp-upload');

const app = express();
app.use(express.static('public')); // Servir les fichiers statiques comme HTML, CSS, JS
const port = 3000;

// Route pour rechercher la bibliothèque musicale
app.get('/search-music', (req, res) => {
// Implémentation pour rechercher la bibliothèque musicale
exec('find /path/to/network -type d', (error, stdout, stderr) => {
// Servir les fichiers statiques depuis le dossier public
app.use(express.static(path.join(__dirname, 'public')));

// Route pour la page d'accueil
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'index.html'));
});

// Route pour rechercher des répertoires
app.get('/find-directory', (req, res) => {
const networkPath = req.query.path; // Récupère le chemin du dossier réseau

// Commande find
exec(`find ${networkPath} -type d`, (error, stdout, stderr) => {
if (error) {
return res.status(500).send(`Erreur: ${stderr}`);
}
Expand All @@ -20,7 +30,9 @@ app.get('/search-music', (req, res) => {

// Route pour lancer l'analyse
app.get('/start-analysis', (req, res) => {
const command = 'blissify init';

const networkPath = req.query.path;
const command = `blissify init ${networkPath}`;
const analysis = exec(command);

analysis.stdout.on('data', (data) => {
Expand Down
2 changes: 1 addition & 1 deletion webapp/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ <h1>Blissify Webapp</h1>
<!-- Bouton pour rechercher la bibliothèque musicale -->
<form id="network-path-form">
<label for="network-path">Entrez le chemin du dossier réseau :</label>
<input type="text" id="network-path" name="network-path" placeholder="smb://192.168.1.xxx/Musique" required>
<input type="text" id="network-path" name="network-path" placeholder="i.e. \\192.168.1.xxx/Music" required>
<button type="submit">Rechercher</button>
</form>

Expand Down

0 comments on commit 9c9c5b2

Please sign in to comment.