diff options
| author | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-27 08:59:55 +0000 |
|---|---|---|
| committer | nanalelfe <nargiza.nosirova@mail.utoronto.ca> | 2016-07-27 08:59:55 +0000 |
| commit | 197e17a7bcbb5459897b7f334a790706c064c31c (patch) | |
| tree | af4c3ebb095261dceac8fd00229d01bf1282f3d1 /node_modules/express-minify/examples/no_minify.js | |
| parent | b0cbe2db0ee3311fc028e7229749726d4cfe6973 (diff) | |
| parent | 21a885311321299163b4cae69d672baaddfba37b (diff) | |
Merge branch 'master' of https://github.com/HumairAK/solutions_repo
Diffstat (limited to 'node_modules/express-minify/examples/no_minify.js')
| -rw-r--r-- | node_modules/express-minify/examples/no_minify.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/node_modules/express-minify/examples/no_minify.js b/node_modules/express-minify/examples/no_minify.js deleted file mode 100644 index b8dfc30..0000000 --- a/node_modules/express-minify/examples/no_minify.js +++ /dev/null @@ -1,48 +0,0 @@ -var minify = require('express-minify'); -var express = require('express'); -var app = express(); - -app.use(function(req, res, next) -{ - // for all *.min.css or *.min.js, do not minify it - if (/\.min\.(css|js)$/.test(req.url)) { - res._no_minify = true; - } - next(); -}); - -app.use(minify()); - -app.get('/server_time_min.jsonp', function(req, res) -{ - var obj = { - 'ok': true, - 'data': { - 'timestamp': new Date().getTime() - } - }; - - // minify this response, but do not cache it - res._no_cache = true; - res.setHeader('Content-Type', 'application/javascript'); - res.send("callback(" + JSON.stringify(obj, null, 4) + ");"); -}); - -app.get('/server_time.jsonp', function(req, res) -{ - var obj = { - 'ok': true, - 'data': { - 'timestamp': new Date().getTime() - } - }; - - // do not minify this response - res._no_minify = true; - res.setHeader('Content-Type', 'application/javascript'); - res.send("callback(" + JSON.stringify(obj, null, 4) + ");"); -}); - -app.use(express.static(__dirname + '/static')); - -app.listen(8080);
\ No newline at end of file |
