On Thu, Dec 27, 2012 at 12:21 PM, Rodrigo Fonseca <[email protected]>wrote:
> No, the server is* created once*, and the (anonymous) function that was > passed to createServer is called each time a request is handled. That > function sends back the contents of the file that was read earlier. > > Ok, it´s created once, but, if there is another server that was created? > I have to put the same port? Another thing interesting, when i put the same > port or any other port in listen() is that when i reload in the first > time my view is rendered normally, on the second time my view lose the > css and on the third time i lost the contact with the server, but when i > don´t put anything in listen, the view render normally, why? I'm reading > these tutorial, understanding a bit the node, but this is really curious > for me... > You haven't mentioned CSS before, and you haven't shown us the HTML content, so it's a little hard to know what's going on. However, I should point out that you are responding to *every* request to your server with the contents of the HTML file. So if your CSS URL is also pointing to the same server, it's going to retrieve HTML content and not CSS content. That would not be good! You would need to look at the request, in your server, to determine what you should be sending back. Again, the tutorials should help you understand this better. -- Martin Cooper It might be a good idea for you to work through one or two tutorials on > Node, so that you get a clearer picture of how it all works. You'll find > pointers to several of those in the archives of this list. Those at > http://www.nodetuts.com/ and http://www.nodebeginner.org/ seem to be > fairly frequently referenced here. > I started with nodebeginner, i'm really enjoying, thanks again. > > > > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en > -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
