Drag & drop image or video here to publish
@@ -22,7 +22,7 @@Drag & drop image or video here
OR
diff --git a/config/speechConfig_example.js b/config/speechConfig_example.js index d10745a3..f485fb34 100644 --- a/config/speechConfig_example.js +++ b/config/speechConfig_example.js @@ -19,4 +19,7 @@ module.exports = { session: { sessionKey: null, // enter a secret key to be used for session encryption }, + files: { + uploadDirectory: null, // enter file path to where uploads/publishes should be stored + }, }; diff --git a/routes/api-routes.js b/routes/api-routes.js index edcc6cb7..e8e28b71 100644 --- a/routes/api-routes.js +++ b/routes/api-routes.js @@ -1,6 +1,7 @@ const logger = require('winston'); const multipart = require('connect-multiparty'); -const multipartMiddleware = multipart({uploadDir: '/home/lbry/test/'}); +const config = require('../config/speechConfig.js'); +const multipartMiddleware = multipart({uploadDir: config.files.uploadDirectory}); const db = require('../models'); const { publish } = require('../controllers/publishController.js'); const { getClaimList, resolveUri } = require('../helpers/lbryApi.js'); diff --git a/speech.js b/speech.js index 19253e10..7e7a4e5f 100644 --- a/speech.js +++ b/speech.js @@ -1,7 +1,6 @@ // load dependencies const express = require('express'); const bodyParser = require('body-parser'); -const siofu = require('socketio-file-upload'); const expressHandlebars = require('express-handlebars'); const Handlebars = require('handlebars'); const handlebarsHelpers = require('./helpers/handlebarsHelpers.js'); @@ -32,7 +31,6 @@ app.use(helmet()); // set HTTP headers to protect against well-known web vulnera app.use(express.static(`${__dirname}/public`)); // 'express.static' to serve static files from public directory app.use(bodyParser.json()); // 'body parser' for parsing application/json app.use(bodyParser.urlencoded({ extended: true })); // 'body parser' for parsing application/x-www-form-urlencoded -app.use(siofu.router); // 'socketio-file-upload' router for uploading with socket.io app.use((req, res, next) => { // custom logging middleware to log all incoming http requests logger.verbose(`Request on ${req.originalUrl} from ${req.ip}`); logger.debug('req.body:', req.body); @@ -76,7 +74,7 @@ db.sequelize .then(hostedContentPath => { // add the hosted content folder at a static path app.use('/media', express.static(hostedContentPath)); - // require routes & wrap in socket.io + // require routes require('./routes/auth-routes.js')(app); require('./routes/api-routes.js')(app); require('./routes/page-routes.js')(app); diff --git a/views/index.handlebars b/views/index.handlebars index 09c01c0e..0b09d8a6 100644 --- a/views/index.handlebars +++ b/views/index.handlebars @@ -1,8 +1,8 @@
Drag & drop image or video here to publish
@@ -22,7 +22,7 @@Drag & drop image or video here
OR