HelloWordl in Webserver
Xan
xancorreu at gmail.com
Tue Apr 3 01:41:59 PDT 2012
I receive errors:
xan at gerret:~/proves/dlang-proves$ ls
cgi.d functions.d httpd.d netman.d server.d
xan at gerret:~/proves/dlang-proves$ gdmd-4.6 server.d cgi.d
netman.d httpd.d
httpd.d:5: Error: module netman is in file 'arsd/netman.d' which
cannot be read
import path[0] = /usr/include/d2/4.6/i686-linux-gnu
import path[1] = /usr/include/d2/4.6
What fails?
I use gdmd instead of dmd
On Saturday, 17 March 2012 at 20:18:39 UTC, Adam D. Ruppe wrote:
> On Saturday, 17 March 2012 at 20:08:24 UTC, Xan wrote:
>> I'm convinced there is a D equivalent?
>
> It all depends on the library. If you use my code
> https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff
>
> It looks like this:
>
> ==
> import arsd.cgi;
> void hello(Cgi cgi) {
> cgi.write("Hello, world!");
> }
> mixin GenericMain!hello;
> ==
>
>
> You can build that as a cgi app to drop into any
> web server, a FastCGI app to use a longer running
> process on almost any webserver, or a HTTP server,
> standalone.
>
> Get cgi.d from my github then
>
> dmd hello.d cgi.d # builds cgi version
> dmd hello.d cgi.d -version=fastcgi # fastcgi, you also need the
> Fast CGI C library from the internet (search for libfcgi)
>
> or get netman.d and httpd.d and
>
> dmd hello.d cgi.d netman.d httpd.d -version=embedded_httpd #
> standalone, only works on linux
More information about the Digitalmars-d-learn
mailing list