Re: [JSMentors] passing external resources like images, stylesheets, etc to a Node app

2011-11-23 Thread Poetro
2011/11/23 dtang85 dtan...@gmail.com: I have a view in my Node app, but the external CSS file does not link properly. How do I allow the server I created to send that resource? Im very new to this so even a hardcoded static solution would be good. Here is the JS code that I run in Node: var

Re: [JSMentors] Re: Getting error while calling the inherited method

2011-11-23 Thread Cédric Bertolini
Well, I had never seen this pattern before: function Admin(first, last) { Person.call(this, first, last); } It's interesting, but you're making a lot of assumptions about Person. You can only use that if you thightly control Person and Admin. function F() {} F.prototype =

[JSMentors] Re: Getting error while calling the inherited method

2011-11-23 Thread Scott Sauyet
Cédric Bertolini wrote: Well, I had never seen this pattern before: function Admin(first, last)  {     Person.call(this, first, last); } It's interesting, but you're making a lot of assumptions about Person. You can only use that if you thightly control Person and Admin. Not exactly. You

[JSMentors] Re: passing external resources like images, stylesheets, etc to a Node app

2011-11-23 Thread dtang85
Thanks! On Nov 23, 5:12 am, Poetro poe...@gmail.com wrote: Forgot, that the end is already triggered, so the streaming is just the following:         if (pathname === '/style.css') {                 // Open a file stream to the file                 stream = fs.createReadStream('style.css');