comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: AWS applications and domain hosting
Date: 01 Jul 2005 01:58:35 +0200
Date: 2005-07-01T01:58:35+02:00	[thread overview]
Message-ID: <m27jgbcs7o.fsf@hugin.crs4.it> (raw)
In-Reply-To: umzp7poaa.fsf@obry.net

Pascal Obry wrote:
> Randy Brukardt wrote:

> > >  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;
> >>

I wasn't aware of the AWS.Response.File function.  Does this it stream
the file?  Or do you have to load it into memory first?  If AWS knows
how to stream files, my point about handing out files is clearly not
valid.

How about handling of content negotiation?  Can AWS also do that for
me?  (yes, I _could_ read the manual) Or will I get the pleasure of
implementing that myself?

My example, <http://da.speling.org/random_words/>, will continue to
run as described, since we have many different web sites on that
machine, and I wouldn't like to force the other administrators to use
AWS just because I run a small service implemented with AWS. - And
restarting the whole HTTP daemon every time I feel like tweaking my
toy isn't healthy either. -- But with what I've learnt now, I might
try to implement a proper (for my purposes) web server using AWS for
my own site.

Jacob
-- 
"Computer Science is to Science, as Plumbing is to Hydrodynamics"



  reply	other threads:[~2005-06-30 23:58 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
2005-06-30 23:58         ` Jacob Sparre Andersen [this message]
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