[AWS] Building the web server “Hello World”

Jilani Khaldi jilani at cheapnet.it
Tue Oct 16 19:50:16 CEST 2007


Hi All,
just arrived on AWS!
I have installed GNAT Ada on a linux box (Slackware 10.2) and it works. 
Now I have installed AWS and I have been trying in vain to get the 
server "Hello World" working.

I have GNAT Ada and AWS installed under /usr/gnat...
I have tried many commands combinations. The last error I got is: 
"ssl-thin.ads" not found. In fact there is no file in my system with 
that name, but there is instead "ssl-thin_openssl.ads".
My question now is:
gnatmake ???? to get the server compiled?
Thank you!
JK

This is the code taken from the User's Guide.

      with AWS.Response;
      with AWS.Server;
      with AWS.Status;

      procedure Hello_World is

         WS : AWS.Server.HTTP;

         function HW_CB (Request : in AWS.Status.Data)
           return AWS.Response.Data
         is
            URI : constant String := Status.URI (Request);
         begin
            if URI = "/hello" then
               return AWS.Response.Build ("text/html", "<p>Hello world !");
            else
               return AWS.Response.Build ("text/html", "<p>Hum...");
            end if;
         end HW_CB;

      begin
         AWS.Server.Start
            (WS, "Hello World", Callback => HW_CB'Unrestricted_Access);
         delay 30.0;
      end Hello_World;
-- 




More information about the AWS mailing list