mirror of https://github.com/calzoneman/sync.git
Add configuration option to use express-minify for CSS and JS
This commit is contained in:
parent
e6acf92bdb
commit
6fe31b9a3e
|
@ -15,6 +15,8 @@ http:
|
|||
host: ''
|
||||
port: 8080
|
||||
domain: 'http://localhost'
|
||||
# Use express-minify to minify CSS and Javascript
|
||||
minify: false
|
||||
|
||||
# HTTPS server details
|
||||
https:
|
||||
|
|
|
@ -25,7 +25,8 @@ var defaults = {
|
|||
http: {
|
||||
host: "",
|
||||
port: 8080,
|
||||
domain: "http://localhost"
|
||||
domain: "http://localhost",
|
||||
minify: false
|
||||
},
|
||||
https: {
|
||||
enabled: false,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"socket.io": "~0.9.16",
|
||||
"nodemailer": "~0.6.0",
|
||||
"cookie": "~0.1.0",
|
||||
"yamljs": "~0.1.4"
|
||||
"yamljs": "~0.1.4",
|
||||
"express-minify": "0.0.7"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
var cfg = {
|
||||
"mysql-server": "localhost",
|
||||
"mysql-user": "syncdevel",
|
||||
"mysql-db": "syncdevel",
|
||||
"mysql-pw": "tacky",
|
||||
"debug": true
|
||||
};
|
||||
|
||||
var Database = require("./database");
|
||||
|
||||
var db = new Database(cfg);
|
||||
var assert = require('assert');
|
||||
db.init();
|
||||
|
||||
setTimeout(function () {
|
||||
db.channelExists("adsjnfgjdsg", function (err, res) {
|
||||
assert(!err && !res);
|
||||
});
|
||||
|
||||
db.channelExists("xchan", function (err, res) {
|
||||
assert(!err && res);
|
||||
});
|
||||
|
||||
db.removeFromLibrary("xchan", "xxx2364", function (err, res) {
|
||||
assert(!err);
|
||||
console.log(res);
|
||||
});
|
||||
|
||||
db.getLibraryItem("xchan", "xxx23456", function (err, media) {
|
||||
assert(!err);
|
||||
assert(media === null);
|
||||
});
|
||||
|
||||
db.getLibraryItem("xchan", "G7X5s5vacIU", function (err, media) {
|
||||
assert(!err);
|
||||
assert(media !== null);
|
||||
assert(media.id === "G7X5s5vacIU");
|
||||
});
|
||||
}, 1000);
|
Loading…
Reference in New Issue