[Lazarus] New application type: HTTP standalone server
Michael Van Canneyt
michael at freepascal.org
Thu Jun 2 18:30:06 CEST 2011
Hi,
In revision 31011 I committed support for a HTTP server application in Lazarus,
in the lazwebextra package. This is similar in functionality to the embweb package
by Joost, but it does not use any external packages: you only need the latest FPC
for this (at least rev. 17633).
It has an option to be able to serve regular files out-of-the-box. This is
implemented as a regular fpWeb HTTP module, which simply sends a file if it
finds it. This module is implemented in a (new) unit fpwebfile.
It works similar to the Apache server's Alias directive:
RegisterFileLocation('files','/some/existing/directory');
will map /files/index.html to /some/existing/directory/index.html and send it.
Multiple locations can be registered.
if a mime.types file is present, the correct content-type is sent.
The FPC packages/fcl-web/examples/httpapp directory contains an example of how to use all this.
This means that FPC can now be used out of the box to implement web applications/pages
as
- CGI.
- FastCGI.
- Apache module.
- Standalone webserver.
IIS ISAPI support is planned.
Comments/suggestions welcome.
Michael.
More information about the Lazarus
mailing list