Re: AWS applications and domain hosting




"Randy Brukardt" <randy@xxxxxxxxxxxxxx> 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
.