Skip to content

Commit

Permalink
Merge pull request #34 from equake/master
Browse files Browse the repository at this point in the history
fix to work with connect >= 3.0 and serve-static
  • Loading branch information
Norbert Eder committed Sep 22, 2014
2 parents e3c6ea3 + 02fdac9 commit e8db512
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

var connect = require('connect');
var serveStatic = require('serve-static');
var url = require('url');
var qs = require('qs');
var path = require('path');
Expand All @@ -18,7 +19,7 @@ mu.root = settings.templatePath;

main.use('/node_modules/xcharts/build/xcharts.min.js', utils.serveFile(path.join(settings.root, '/node_modules/xcharts/build/xcharts.min.js'), {'Cache-Control': 'public, max-age=' + (84600 * 365), 'Content-Length' : '0', 'Content-Type' : ''}));
main.use('/node_modules/xcharts/build/xcharts.min.css', utils.serveFile(path.join(settings.root, '/node_modules/xcharts/build/xcharts.min.css'), {'Cache-Control': 'public, max-age=' + (84600 * 365), 'Content-Length' : '0', 'Content-Type' : ''}));
main.use('/static', connect.static(path.join(settings.root, 'static'), {maxAge: 86400000 * 365 }));
main.use('/static', serveStatic(path.join(settings.root, 'static'), {maxAge: 86400000 * 365 }));

main.use('/', function(req, res, next) {

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"optimist": ">=0.3.4",
"xcharts": ">=0.1.3",
"mime": ">=1.2.7",
"connect": ">=2.7.2",
"connect": ">=3",
"serve-static": ">=1",
"qs": ">=0.5.3",
"url": ">=0.7.9",
"mu2": ">=0.5.17"
Expand Down

0 comments on commit e8db512

Please sign in to comment.