Re: Odd Request Handling Behavior

28 views
Skip to first unread message

tjholowaychuk

unread,
Nov 12, 2012, 11:37:31 AM11/12/12
to Express
favicon :D

On Nov 12, 8:27 am, Alex Casanova <alexcasanova2...@gmail.com> wrote:
> Hello, I just started using node.js/express for an application i'm building
> for work.  The app is more or less functional at least for the backend.
>  One thing I noticed which is bugging me is after I did some refactoring. I
> started seeing some weird things happen like a database query returning
> more data than I'd like in the console.  Later it didn't seem like more
> than one row it seemed like the handler was firing more than once.  I quit
> all the node process in the activity monitor to see if that was the issue,
> but i still got the same behavior. I'm new to this so I'm guess it is
> something I'm doing wrong but I can't see where.
>
> for instance I have a simple route for the home page
> /**
>  * Routes
>  */
> app.get('/', function (req, res) {
> console.log("hello World");
> res.render('create');
>
> });
>
> when I look at the console.. I see hello world twice. This behavior is
> happening in other sections of the code which is scaring me.  Doesn't seem
> normal.
> Could someone shed some light. Thanks

Ryan Schmidt

unread,
Nov 12, 2012, 1:09:21 PM11/12/12
to expre...@googlegroups.com
favicon wouldn't match app.get('/', ...)

RGBboy

unread,
Dec 11, 2012, 8:42:58 PM12/11/12
to expre...@googlegroups.com
Some web browsers will pre fetch a page while you are typing the address into the address bar. I know that Google Chrome exhibits this exact problem for my applications.
Reply all
Reply to author
Forward
0 new messages