carlos8f / buffet

Performance-oriented static file server
http://carlos8f.github.com/node-buffet
190 stars 12 forks source link

Can't serve index.html on / #21

Closed ohenepee closed 8 years ago

ohenepee commented 8 years ago

I create a simple express server with buffet and I can't serve the index.html file on this '/' route

var buffet = require('buffet')({root: __dirname}); var express = require('express')();

express .use(buffet) .listen(80, function (err) { if (!err) console.log('Application has started...'); });

Can't one simply use http://localhost instead of http://localhost/index.html? B'cos http://localhost/inde.html works but without index.html it doesn't

This is the error you get with http://localhost:

TypeError: undefined is not a function at checkCache (/home/peps/Desktop/bbws/node_modules/buffet/index.js:71:31) at mw (/home/peps/Desktop/bbws/node_modules/buffet/index.js:40:23) at Layer.handle as handle_request at trim_prefix (/home/peps/Desktop/bbws/node_modules/express/lib/router/index.js:312:13) at /home/peps/Desktop/bbws/node_modules/express/lib/router/index.js:280:7 at Function.process_params (/home/peps/Desktop/bbws/node_modules/express/lib/router/index.js:330:12) at next (/home/peps/Desktop/bbws/node_modules/express/lib/router/index.js:271:10) at expressInit (/home/peps/Desktop/bbws/node_modules/express/lib/middleware/init.js:33:5) at Layer.handle as handle_request at trim_prefix (/home/peps/Desktop/bbws/node_modules/express/lib/router/index.js:312:13)

I hope I'm not doing anything wrong... I'm not a node pro though

carlos8f commented 8 years ago

Hi there, looks like you found a bug :beetle:

Fixed in a newly published version: 1.0.5

Cheers, Carlos