Permalink
Browse files

component-ize

  • Loading branch information...
1 parent 913f910 commit fb1eb24775ef8b16dee28bcdf5bb21313f4c75a9 @TooTallNate committed Aug 25, 2012
Showing with 40 additions and 1 deletion.
  1. +31 −0 index.js
  2. +9 −1 package.json
View
@@ -0,0 +1,31 @@
+
+/**
+ * Module exports.
+ */
+
+exports = module.exports = setup;
+
+/**
+ * Module dependencies.
+ */
+
+var http = require('http');
+var send = require('send');
+var root = __dirname;
+var swf = '/ZeroClipboard.swf';
+
+function setup () {
+ return http.createServer(onReq);
+}
+
+function onReq (req, res) {
+ send(req, swf)
+ .root(root)
+ .on('error', onError)
+ .pipe(res);
+}
+
+function onError (err) {
+ res.statusCode = err.status || 500;
+ res.end(err.message);
+}
View
@@ -17,7 +17,15 @@
"type": "git",
"url": "https://github.com/jonrohan/ZeroClipboard.git"
},
+ "dependencies": {
+ "send": "0"
+ },
"devDependencies": {
"uglify-js": "1.2.3"
+ },
+ "component": {
+ "scripts": {
+ "zeroclipboard": "src/javascript/ZeroClipboard.js"
+ }
}
-}
+}

0 comments on commit fb1eb24

Please sign in to comment.