vibed: how to use pure HTML instead of template engine?

wobbles via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 7 01:21:37 PDT 2015


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.


More information about the Digitalmars-d-learn mailing list