Merge pull request #2851 from thelounge/xpaw/express
Force express server to run in production mode
This commit is contained in:
commit
90f8b9a817
@ -52,7 +52,7 @@ class Uploader {
|
|||||||
} while (fs.stat(destPath, (err) => (err ? true : false)));
|
} while (fs.stat(destPath, (err) => (err ? true : false)));
|
||||||
|
|
||||||
fsextra.move(data.file.pathName, destPath).then(() => {
|
fsextra.move(data.file.pathName, destPath).then(() => {
|
||||||
const slug = path.basename(data.file.pathName);
|
const slug = encodeURIComponent(path.basename(data.file.pathName));
|
||||||
const url = `uploads/${randomName}/${slug}`;
|
const url = `uploads/${randomName}/${slug}`;
|
||||||
socket.emit("upload:success", url);
|
socket.emit("upload:success", url);
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
@ -46,6 +46,7 @@ module.exports = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const app = express()
|
const app = express()
|
||||||
|
.set("env", "production")
|
||||||
.disable("x-powered-by")
|
.disable("x-powered-by")
|
||||||
.use(allRequests)
|
.use(allRequests)
|
||||||
.use(index)
|
.use(index)
|
||||||
|
Loading…
Reference in New Issue
Block a user