server bugfix
This commit is contained in:
parent
f6f02ebee0
commit
47d14f6fad
2 changed files with 10 additions and 2 deletions
|
|
@ -403,7 +403,7 @@ button {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.roomsel .title {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
|
|
|
||||||
10
server.js
10
server.js
|
|
@ -144,6 +144,8 @@ fastify.post("/entry", async function (request, reply) {
|
||||||
let tmpdir = path.dirname(audiofile.filepath);
|
let tmpdir = path.dirname(audiofile.filepath);
|
||||||
// console.log(audiofile.fields.message.value);
|
// console.log(audiofile.fields.message.value);
|
||||||
|
|
||||||
|
console.log("hi.");
|
||||||
|
|
||||||
//convert to mp3 ?
|
//convert to mp3 ?
|
||||||
var converted = false;
|
var converted = false;
|
||||||
if (path.extname(audiofile.filename) !== ".mp3") {
|
if (path.extname(audiofile.filename) !== ".mp3") {
|
||||||
|
|
@ -171,9 +173,13 @@ fastify.post("/entry", async function (request, reply) {
|
||||||
// console.log(await fs.readdir(tmpdir));
|
// console.log(await fs.readdir(tmpdir));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("ok.");
|
||||||
|
|
||||||
//upload
|
//upload
|
||||||
const client = new Client(server);
|
const client = new Client(server);
|
||||||
|
|
||||||
|
console.log("good.");
|
||||||
|
|
||||||
//create unique folder ==> timestamp + uuid
|
//create unique folder ==> timestamp + uuid
|
||||||
const folder = await client.createFolder("Storage/public/sound-parade/" + moment().tz('Asia/Seoul').format('YYYYMMDD-HHmmss-') + uuidv1());
|
const folder = await client.createFolder("Storage/public/sound-parade/" + moment().tz('Asia/Seoul').format('YYYYMMDD-HHmmss-') + uuidv1());
|
||||||
if (converted) {
|
if (converted) {
|
||||||
|
|
@ -189,7 +195,9 @@ fastify.post("/entry", async function (request, reply) {
|
||||||
pass: audiofile.fields.pass.value
|
pass: audiofile.fields.pass.value
|
||||||
})));
|
})));
|
||||||
|
|
||||||
//reply.send('done!');
|
console.log("done.");
|
||||||
|
|
||||||
|
reply.send('done!');
|
||||||
//reply.redirect('/submit');
|
//reply.redirect('/submit');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue