aboutsummaryrefslogtreecommitdiff
path: root/node_modules/express-minify/examples/dynamic.js
diff options
context:
space:
mode:
authornanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-27 00:03:35 +0000
committernanalelfe <nargiza.nosirova@mail.utoronto.ca>2016-07-27 00:03:35 +0000
commit8beb37ed67b5f2fa0f9aa85499a8f11b39c9d067 (patch)
treebd4b05a1e374b6cb10097bbcfbc12ef51c1cb85b /node_modules/express-minify/examples/dynamic.js
parent5e73fe37c32faf821d3d16f0251007e366cb090b (diff)
need pull
Diffstat (limited to 'node_modules/express-minify/examples/dynamic.js')
-rw-r--r--node_modules/express-minify/examples/dynamic.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/node_modules/express-minify/examples/dynamic.js b/node_modules/express-minify/examples/dynamic.js
new file mode 100644
index 0000000..d3e1f10
--- /dev/null
+++ b/node_modules/express-minify/examples/dynamic.js
@@ -0,0 +1,24 @@
+var minify = require('express-minify');
+var express = require('express');
+var app = express();
+
+var responseJS =
+ "(function(window, undefined)\n" +
+ "{\n" +
+ "\n" +
+ " var hello = 'hello';\n" +
+ "\n" +
+ " var world = 'world';\n" +
+ "\n" +
+ " alert(hello + world);\n" +
+ "\n" +
+ "})(window);"
+
+app.use(minify());
+app.get('/response.js', function(req, res)
+{
+ res.setHeader('Content-Type', 'application/javascript');
+ res.end(responseJS);
+});
+
+app.listen(8080); \ No newline at end of file