On Thursday, 7 May 2015 at 09:08:53 UTC, wobbles wrote:
On Thursday, 7 May 2015 at 08:25:30 UTC, Suliman wrote:
You're not setting a port.
add:
settings.port = 8080;
before listenHTTP();
then it'll work.
It's do not help :(
You're sure?
My app.d is:
import std.stdio;
import vibe.d;
shared static this(){
auto router = new URLRouter;
router.get("*", serveStaticFiles("./public/"));
auto settings = new HTTPServerSettings;
settings.port = 8080;
listenHTTP(settings, router);
}
And i have a file
public/index.html
<html>
<body>
<h1> Hi </h1>
</body>
</html>
When I navigate to localhost:8080 i can see a big "Hi".
I see you have you're function called setupServer()
Are you using the vibe default main or you're own main function?
It's possible you're not setting up the event loop correctly.
At -> http://vibed.org/docs search for "The main function" and
you'll see how to set it up correctly.