Upload files to ''

This commit is contained in:
Creuzdos 2020-03-08 15:34:30 +00:00
parent ccebba2825
commit b02cdcefa7
2 changed files with 44 additions and 0 deletions

29
index.html Normal file
View File

@ -0,0 +1,29 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>SoundBox du Channel Ultime</title>
<meta name="description" content="SoundBox du Channel Ultime">
<meta name="author" content="Creuzdos">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<h1> SoundBox du Channel Ultime </h1>
<div id="app" class="row">
<div v-for="son in listeDeSons" class="col s6 m4 l3 xl2 son">
<div class="titre">{{son.replace(".mp3","")}}</div>
<audio controls>
<source v-bind:src="'Sounds/' + son" type="audio/mpeg">
</audio>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="js/vueApp.js"></script>
</body>
</html>

15
index.js Normal file
View File

@ -0,0 +1,15 @@
const express = require('express');
const fs = require('fs');
let app = express();
app.use(express.static('.'));
app.get('/', function(request, response){
response.sendFile('index.html');
});
app.get('/Sounds', function(request, response){
const dir = fs.readdirSync('./Sounds');
response.send(dir);
//console.log(dir);
});
app.listen(3000);