/+ dub.sdl: name "test" dependency "vibe-d" version="~>0.7.29" +/ import vibe.http.server; void main() { auto settings = new HTTPServerSettings; settings.port = 8080; listenHTTP(settings, &hello); } void hello(HTTPServerRequest req, HTTPServerResponse res) { res.writeBody("Hello, World!"); }
The script above can be invoked with "dub --single test.d".
Loads a single file package.
Single-file packages are D files that contain a package receipe comment at their top. A recipe comment must be a nested /+ ... +/ style comment, containing the virtual recipe file name and a colon, followed by the recipe contents (what would normally be in dub.sdl/dub.json).