Permalink
Browse files

Create a combo loader node.js app.

yaypie's comboloader takes care of all the heavy lifting here.  I just point to
the current symlink and let it do its thing.
  • Loading branch information...
1 parent f1a392c commit 833c5c0f8f792b0b4ea6a6113436ff8c9479f4a2 @rockstar committed Dec 10, 2011
Showing with 21 additions and 0 deletions.
  1. +21 −0 app.js
View
21 app.js
@@ -0,0 +1,21 @@
+var combo = require('combohandler'),
+ express = require('express'),
+ app = express.createServer();
+
+app.configure(function() {
+ app.use(express.errorHandler());
+});
+
+app.error(function (err, req, res, next) {
+ if (err instanceof combo.BadRequest) {
+ res.send('Bad request.', {'Content-Type': 'text/plain'}, 400);
+ } else {
+ next();
+ }
+});
+
+app.get('/', combo.combine({rootPath: 'build/www'}), function (req, res) {
+ res.send(res.body, 200);
+});
+
+app.listen(8082);

0 comments on commit 833c5c0

Please sign in to comment.