dlang website design

Wulfklaue via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 24 15:57:00 PDT 2017


On Saturday, 24 June 2017 at 22:18:29 UTC, Timon Gehr wrote:
> $ cat main.d
> /++ dub.sdl
>     name "webserver"
>     dependency "vibe-d:http" version="~>0.7.31"
> +/
> module main;
>
> import vibe.core.core;
> import vibe.http.fileserver;
> import vibe.http.server;
>
> void main()
> {
>     listenHTTP(new HTTPServerSettings, serveStaticFiles("./"));
>     runApplication();
> }
> $ dub main.d
> readPackageRecipe called with filename with unknown extension: 
> + dub.sdl
>     name "webserver"
>     dependency "vibe-d
>
> What am I doing wrong?

See the post above yours. Attempt 3:

Run:

* CMD> dub init projectname
* Enter sdl for your project file
* Enter the rest like you want
* CMD> cd projectname
* Edit the dub.sdl file and add the "dependency "vibe-d:http" 
version="~>0.7.31"" at the end.
* CMD> cd src
* Now edit the app.d file and replace the code with. No need for 
the /++ stuff.

> module main;
>
> import vibe.core.core;
> import vibe.http.fileserver;
> import vibe.http.server;
>
> void main()
> {
>     listenHTTP(new HTTPServerSettings, serveStaticFiles("./"));
>     runApplication();
> }

* Go back to your projectname folder and run dub
* CMD> dub
* And with some luck it will run correctly.


And thank for proving my point that some do not understand that 
something they consider simply, is not always simply for people 
doing it the first time.

Now frankly, if the whole /++ dub.sdl +/ actually worked as a 
file based dependency, now that will be a interesting feature ;)


More information about the Digitalmars-d mailing list