RejectedSoftware Forums

Sign up

Serving Static Files

Hello,

I'm looking for an example of how to serve a static "index.html" file
from Vibe. Couldn't find anything in the docs. Maybe I've just missed
it. Could someone provide and example or point me to one please?

Thanks,
Andrew

Re: Serving Static Files

Am 24.06.2013 06:59, schrieb Andrew Edwards:

Hello,

I'm looking for an example of how to serve a static "index.html" file
from Vibe. Couldn't find anything in the docs. Maybe I've just missed
it. Could someone provide and example or point me to one please?

Thanks,
Andrew

There is a basic example in the examples/httpstaticserver folder of
vibe.d. It will serve all files in its public sub folder. Also, there is
a new method to serve only a single file, serveStaticFile, for the
cases where that makes sense.

Re: Serving Static Files

On 6/24/13 5:57 AM, Sönke Ludwig wrote:

Am 24.06.2013 06:59, schrieb Andrew Edwards:

Hello,

I'm looking for an example of how to serve a static "index.html" file
from Vibe. Couldn't find anything in the docs. Maybe I've just missed
it. Could someone provide and example or point me to one please?

Thanks,
Andrew

There is a basic example in the examples/httpstaticserver folder of
vibe.d. It will serve all files in its public sub folder. Also, there is
a new method to serve only a single file, serveStaticFile, for the
cases where that makes sense.

Just what I was looking for. Thanks.