comp.lang.ada
 help / color / mirror / Atom feed
From: Pascal Obry <pascal@obry.net>
Subject: Re: AWS applications and domain hosting
Date: 30 Jun 2005 22:45:01 +0200
Date: 2005-06-30T22:45:13+02:00	[thread overview]
Message-ID: <umzp7poaa.fsf@obry.net> (raw)
In-Reply-To: eJGdnW3QHa8Y01nfRVn-qg@megapath.net


"Randy Brukardt" <randy@rrsoftware.com> writes:

> >  a) You don't have to implement plain handing out of static files
> >     yourself.
> 
> That's such a trivial task (assuming that AWS includes appropriate handling
> of HTTP commands) that's it's pretty silly not to include it and avoid extra
> failure points.

This is indeed one of the AWS example. A static file server is built in AWS
using a 10 lines procedure callback:

<<
   function Get (Request : in AWS.Status.Data) return AWS.Response.Data is
      URI      : constant String := AWS.Status.URI (Request);
      Filename : constant String := URI (2 .. URI'Last);
   begin
      if OS_Lib.Is_Regular_File (Filename) then
         return AWS.Response.File
           (Content_Type => AWS.MIME.Content_Type (Filename),
            Filename     => Filename);

      else
         return AWS.Response.Acknowledge
           (Messages.S404, "<p>Page '" & URI & "' Not found.");
      end if;
   end Get;
>>

This handles the 404 message too. Note that such routine is provided by AWS,
see AWS.Services.Page_Server. If this is not sufficient there is another
hight level service which also handles directory browing, see
AWS.Services.Directory.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



  reply	other threads:[~2005-06-30 20:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-26  9:36 AWS applications and domain hosting Martin Dowie
2005-06-26 10:51 ` Adrian Knoth
2005-06-26 12:36 ` Jacob Sparre Andersen
2005-06-26 13:18 ` Larry Kilgallen
2005-06-26 19:29 ` Marius Amado Alves
2005-06-26 22:46   ` Jacob Sparre Andersen
2005-06-30 20:00     ` Randy Brukardt
2005-06-30 20:45       ` Pascal Obry [this message]
2005-06-30 23:58         ` Jacob Sparre Andersen
2005-07-01  6:01           ` Pascal Obry
2005-07-02 20:28             ` Jacob Sparre Andersen
2005-07-02 21:50               ` Pascal Obry
     [not found]       ` <m23bqzcrew.fsf@hugin.crs4.it>
2005-07-01  1:45         ` Randy Brukardt
2005-06-26 23:00   ` Björn Persson
2005-06-26 23:45     ` Marius Amado Alves
2005-06-29  2:42     ` tmoran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox