Commit 12adf9a8 authored by Frauke's avatar Frauke

Change upload directory

parent 1a761e09
......@@ -6,6 +6,7 @@ const logger = require('winston')
const cookie = require('cookie')
const path = require('path')
const os = require('os')
const fileUtils = require('./helpers/fileUtils')
const feathers = require('@feathersjs/feathers')
// Set the Node configuration directory to server/config instead of the default
......@@ -28,6 +29,14 @@ const appHooks = require('./app.hooks')
const channels = require('./channels')
const dataDirectoryPath = path.join(os.homedir(), '.hallo.gent')
fileUtils.makeDir(`${dataDirectoryPath}/uploads/`)
.catch(err => {
throw err
})
const secretFile = require(`${dataDirectoryPath}/secret.json`)
const app = express(feathers())
......
const multer = require('multer')
const mime = require('mime-types')
const fileUtils = require('../helpers/fileUtils')
const os = require('os')
const path = require('path')
const dataDirectoryPath = path.join(os.homedir(), '.hallo.gent')
// storage for header and profile images
const infoStorage = multer.diskStorage({
destination: function (req, file, next) {
fileUtils.makeDir(`./client/static/uploads/${req.params.__feathersId}`).then(() => {
next(null, `./client/static/uploads/${req.params.__feathersId}`)
fileUtils.makeDir(`${dataDirectoryPath}/uploads/${req.params.__feathersId}`).then(() => {
next(null, `${dataDirectoryPath}/uploads/${req.params.__feathersId}`)
}).catch(err => {
throw err
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment