Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7 #7

Merged
merged 1 commit into from
Sep 1, 2024
Merged

7 #7

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker image
Expand Down
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
Loading