digitalmars.D - Is there an embeddable HTTP server in D?
- Arun Chandrasekaran (7/7) Jun 29 2016 In C++ land, I've used cpp-netlib[0] to create a HTTP server. Is
- Dicebot (3/10) Jun 29 2016 http://vibed.org
- ketmar (3/3) Jun 29 2016 Adam's cgi.d from arsd repo[1] contains built-in server
- Adam D. Ruppe (14/16) Jun 29 2016 Indeed. To use this, download cgi.d:
In C++ land, I've used cpp-netlib[0] to create a HTTP server. Is there a similar library in D? cpp-netlib uses Boost ASIO and it supports synchronous and asynchronous HTTP servers. It also support HTTP client API (which I've not used). Arun [0] http://cpp-netlib.org/0.11.2/index.html
Jun 29 2016
On Wednesday, 29 June 2016 at 20:39:45 UTC, Arun Chandrasekaran wrote:In C++ land, I've used cpp-netlib[0] to create a HTTP server. Is there a similar library in D? cpp-netlib uses Boost ASIO and it supports synchronous and asynchronous HTTP servers. It also support HTTP client API (which I've not used). Arun [0] http://cpp-netlib.org/0.11.2/index.htmlhttp://vibed.org
Jun 29 2016
Adam's cgi.d from arsd repo[1] contains built-in server implementation too, it as one of the available options. [1] https://github.com/adamdruppe/arsd
Jun 29 2016
On Thursday, 30 June 2016 at 00:10:54 UTC, ketmar wrote:Adam's cgi.d from arsd repo[1] contains built-in server implementation too, it as one of the available options.Indeed. To use this, download cgi.d: https://raw.githubusercontent.com/adamdruppe/arsd/master/cgi.d then make a program like: import arsd.cgi; void hello(Cgi cgi) { cgi.write("Hello!"); } mixin GenericMain!hello; and compile: dmd yourfile.d cgi.d -version=embedded_httpd And you can run the program `yourfile` and it listens on port 8085 by default, or change it at runtime like `./yourfile --port 5000` then go to `http://localhost:5000/` in your browser.
Jun 29 2016