Am 17.02.2016 um 15:48 schrieb Louie Bacani Foronda:
On Tue, 16 Feb 2016 19:09:47 +0100, Sönke Ludwig wrote:
Am 16.02.2016 um 17:40 schrieb Louie Bacani Foronda:
(...)
It is definitely running twice, why is that?The browser is probably requesting "/favicon.ico" in addition to "/".
Try to printreq.requestURL
to know for sure.yep it is requesting favicon.ico, any fix for this? as almost all codes runs twice because of this...
There is no real "fix" for this, because the browser will just do that
no matter what, but you'd usually just restrict the code to run only for
a particular URL. The typical way for low-level code is to use a URLRouter
and then call router.get("/", &hello);
and pass router
to listenHTTP
. See also http://vibed.org/docs#http-routing.