On Thursday, 7 May 2015 at 08:09:50 UTC, Suliman wrote:
Is next example is enough to serv simple index.html page?

void setupServer()
{
        auto router = new URLRouter;
        // add other routes here
        router.get("*", serveStaticFiles("public/"));

        auto settings = new HTTPServerSettings;
        listenHTTP(settings, router);
}

After it's run I open localhost:8080 but browser say that can't connect to the page.

You're not setting a port.

add:
settings.port = 8080;

before listenHTTP();

then it'll work.

Reply via email to