On Fri, Dec 28, 2012 at 6:31 AM, Rodrigo Fonseca <[email protected]>wrote:
> *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.*
> *
> *
> * *Sorry, i'm doing a mcv app in node, i have a layout, so all i do is to
> put the content in this layout, so, if the url is "test", this call
> "test_controller", that render "layou/layout" and call "layout_controller"
> where is send to a function "layout" the object from "test_controller", see:
>
Since you're already working within a framework, it is extremely unlikely
that you'll either need or want to create another server, especially inside
a controller. What you describe above sounds like the routing part of the
existing server, so you should be working within that.
I see now that you mentioned Locomotive in your original message here. I'm
not familiar with that, but I see that it has a Google Group of its own.
I'd suggest you ask in that group how you should be addressing your problem
within the context of that framework. You'll likely get more appropriate
responses there, from people who know the framework you're using.
--
Martin Cooper
> LayoutController.layout = function(obj)
> {
> var http = require('http'),
> fs = require('fs');
> var html = fs.readFileSync('./app/views/'+
> obj.__action+'/'+obj.fileName);
> http.createServer(function(request, response) {
> response.writeHeader(200, {"Content-Type": "text/html"});
> response.write(html);
> response.end();
> }).listen();
> obj.content = html;
> obj.render('layout/layout');
> }
>
> As can be seen, this function read in on single place every different obj
> that comes here, but, as you can see, the layout is all the page with css
> and javascript, it's always static, only the content changes. So, as you
> can see again, the listen obj is empty, and it's works perfectly, but when
> i put some port happens what i said before.
>
> --
> 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