vibed: how to use pure HTML instead of template engine?
wobbles via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Thu May 7 02:08:52 PDT 2015
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".
More information about the Digitalmars-d-learn
mailing list