Brook is a cross-platform microframework which helps to develop web Pascal applications built by Delphi or Lazarus IDE and Free Pascal. Its core has been developed using the Sagui library, that's why it is so fast, compact and useful to run on embedded systems.
The example below shows a minimal hello world HTTP server:
type
THTTPServer = class(TBrookHTTPServer)
protected
procedure DoRequest(ASender: TObject; ARequest: TBrookHTTPRequest;
AResponse: TBrookHTTPResponse); override;
end;
procedure THTTPServer.DoRequest(ASender: TObject; ARequest: TBrookHTTPRequest;
AResponse: TBrookHTTPResponse);
begin
AResponse.Send('Hello world', 'text/plain', 200);
end;
begin
with THTTPServer.Create(nil) do
try
Port := 8080;
if not Active then
Exit;
WriteLn('Server running at http://localhost:', Port);
Open;
ReadLn;
finally
Free;
end;
end.
There are other examples available in the Examples/ directory.
Successfully tested on:
compiled using:
Starting from the version 1.0.0, Brook follows the SemVer rules regarding API changes with backwards compatibility across major releases.
Brook framework is released under GNU Lesser General Public License v2.1. Check the LICENSE file for more details.
The documentation has been written in PasDoc and is available in HTML format at brookframework-docs/index.html.
All stable releases are available for download at the releases page.
To download the very latest source from the Git server, do this:
git clone https://github.com/risoflora/brookframework.git
It will create a directory named brookframework filled with the source code.
Brook framework is totally open source and would not be possible without our contributors. If you want to submit contributions, please fork the project on GitHub and send a pull request. You retain the copyright on your contributions. If you have questions, open a new issue at the issues page. For donations to support this project, please click the button below.
If you are Brazilian and want to donate using more options in BRL, please make an identified Nubank deposit or use this PayPal link.
See the name of all donors in DONORS file. :green_heart:
This project is completely self-explanatory, but, if you need a consulting service to integrate it on your project, contact us.