Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
inventionpro committed Aug 30, 2024
1 parent 5f004d2 commit 58e0657
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions apis/tts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ const fs = require("fs");
const { getAudioBuffer } = require('simple-tts-mp3');

module.exports = {
path: '/tts',
info: 'Generates text to speach audio',
type: 'get',
path: '/tts',
info: 'Generates text to speach audio',
type: 'get',
params: [
{
name: 'text',
Expand All @@ -17,9 +17,9 @@ module.exports = {
default: 'en'
}
],
category: "audio",
category: "audio",

async execute(req, res) {
async execute(req, res) {
if (!req.query['text']) {
res.error('Include text')
return;
Expand All @@ -39,5 +39,5 @@ module.exports = {
res.error('Could not convert')
return;
})
}
}
}
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ app.use(function(req,res,next){
})

app.use('/images', express.static('images'))
app.use('/download', express.static('images'))

app.use(function(req,res,next){
if (req.url.includes('/download/')) {
res.setHeader('Content-Disposition', `attachment; filename=${filename}`);
res.setHeader('Content-Disposition', `attachment; filename=${req.url.split('/download/')[1].split('/').slice(-1)[0]}`);
}
next()
})
app.use('/download', express.static('images'))

/* -- Mark the files with fs to var apis -- */
const getAllFiles = function (endsin, dirPath, arrayOfFiles) {
Expand Down

0 comments on commit 58e0657

Please sign in to comment.