Am 16.02.2016 um 17:40 schrieb Louie Bacani Foronda:
import vibe.d; import std.stdio; shared static this() { auto settings = new HTTPServerSettings; settings.port = 8080; settings.bindAddresses = ["::1", "127.0.0.1"]; listenHTTP(settings, &hello); logInfo("Please open http://127.0.0.1:8080/ in your browser."); } void hello(HTTPServerRequest req, HTTPServerResponse res){ writeln("running once or twice?"); res.writeBody("Yep you are here..."); }
I created a simple project, I noticed that things are running twice?
the console says
Please open http://127.0.0.1:8080/ in your browser
running once or twice?
running once or twice?It is definitely running twice, why is that?
The browser is probably requesting "/favicon.ico" in addition to "/".
Try to print req.requestURL
to know for sure.