expressjs / serve-static

Serve static files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arguments to path.resolve must be strings

nodesocket opened this issue · comments

Getting Arguments to path.resolve must be strings. Not sure what I am missing.

path.js:313
        throw new TypeError('Arguments to path.resolve must be strings');
              ^
TypeError: Arguments to path.resolve must be strings
    at exports.resolve (path.js:313:15)
    at serveStatic (/node_modules/serve-static/index.js:36:10)
var staticServer = serveStatic('../distribute', {
    dotfiles: 'deny',
    etag: true,
    index: ['index.html'],
    lastModified: true,
    maxAge: ms('30d')
});

https.createServer(sslOptions, function(req, res) {
    var path = url.parse(req.url).pathname;

    ////
    // Match any requests to /proxy/...
    ////
    if(path.match(/proxy\/.?/)) {
        req.headers.host = config.proxy.host;
        proxy.web(req, res, config.proxy);
    }
    ////
    // Serve static content
    ////
    else {
        serveStatic(req, res, finalhandler(req, res));
    }
}).listen(config.listenPort);

Never-mind, I'm an idiot.

serveStatic should be staticServer.

I can at least make this module provide a better message :)