Skip to content
This repository was archived by the owner on Feb 27, 2022. It is now read-only.
This repository was archived by the owner on Feb 27, 2022. It is now read-only.

what version of node can run it? #2

@julianw

Description

@julianw

Hi,
I tried 0.1.26 and 0.1.28.
the server start, but when i connect to http://127.0.0.1:8000/
I had this error

TypeError: Cannot read property 'full' of undefined
at error (/Users/whwong/git/simple-node-server/lib/core.js:123:21)
at Object.SNSProcessor_next (/Users/whwong/git/simple-node-server/lib/core.js:74:46)
at Object.next (/Users/whwong/git/simple-node-server/lib/core.js:60:58)
at Object.SNSProcessor (/Users/whwong/git/simple-node-server/lib/core.js:62:5)
at SNS.SNS_process as processRequest
at Server. (/Users/whwong/git/simple-node-server/lib/core.js:32:12)
at EventEmitter. (/Users/whwong/.node_libraries/.npm/nave/0.1.2/package/installed/0.1.28/lib/node/libraries/http.js:411:23)
at ServerSideConnection. (/Users/whwong/.node_libraries/.npm/nave/0.1.2/package/installed/0.1.28/lib/node/libraries/http.js:332:12)
at node.js:1005:9
failed somehow

in lib/resolve-filename.js, on line 19, my sys.puts show undefined

 11 exports.resolveFilename = function filenameResolverFactory (docroot, prefix) {
 12   if (!docroot) throw new Error("Need a docroot for resolveFilename.");
 13   if (prefix) prefix = prefix.replace(/^\/+/, '');
 14   
 15   return function filenameResolver () {
 16     var conf = this.server.conf,
 17       p, file, self = this;
 18     sys.puts(self.req);
 19     sys.puts(self.req.uri);           // undefined
 20     p = self.req.uri.path.replace(/^\/+/, '');
 21     file = path.join(docroot, (prefix && p.indexOf(prefix) === 0)
 22       ? p.substr(prefix.length) : p);
 23     
 24     posix.stat(file)
 25       .addErrback(self.next)
 26       .addCallback(function resolveFilename (stat) {
 27         self.req.stat = stat;
 28         self.req.filename = file;
 29         self.next();
 30       });
 31   };
 32 };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions