Add configuration option to use express-minify for CSS and JS

This commit is contained in:
Calvin Montgomery 2014-02-04 11:32:52 -06:00
parent e6acf92bdb
commit 6fe31b9a3e
5 changed files with 50 additions and 2 deletions

View file

@ -25,7 +25,8 @@ var defaults = {
http: {
host: "",
port: 8080,
domain: "http://localhost"
domain: "http://localhost",
minify: false
},
https: {
enabled: false,

View file

@ -184,6 +184,11 @@ module.exports = {
app.use(express.json());
app.use(express.urlencoded());
app.use(express.cookieParser());
if (Config.get("http.minify")) {
app.use(require("express-minify")());
Logger.syslog.log("Enabled express-minify for CSS and JS");
}
/* Order here is important
* Since I placed /r/:channel above *, the function will
* not apply to the /r/:channel route. This prevents