The perfect Free Pascal framework for your web applications.
Brook for Free Pascal is the perfect Free Pascal framework for your web applications. It’s pure Pascal. You don’t need to leave your preferred programming language.
It’s complete: simple actions or configurable actions for database access, advanced routing features, wizard for Lazarus, support for internationalization, high compatibility with JSON structures, easy and elegant REST implementation, plugins for varied needs, extensible and decoupled brokers… In fact, you have several reasons to adopt Brook as your web development framework.
Create three files:
cgi1.lpr
;unit1.pas
;brokers.pas
;In cgi1.lpr
, type:
program cgi1;
{$mode objfpc}{$H+}
uses
BrookApplication, Brokers, Unit1;
begin
BrookApp.Run;
end.
In unit1.pas
, type:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
BrookAction;
type
TMyAction = class(TBrookAction)
public
procedure Get; override;
end;
implementation
procedure TMyAction.Get;
begin
Write('Hello world!');
end;
initialization
TMyAction.Register('*');
end.
In brokers.pas
, type:
unit Brokers;
{$mode objfpc}{$H+}
interface
uses
BrookFCLCGIBroker;
implementation
end.
Compile the project cgi1.lpr
and copy the resulting file to CGI directory of your web server. Now, in your web browser, access the following URL:
http://localhost/cgi-bin/cgi1
Open and install the file brookex.lpk . After the installation, select _File |
New …_ and, in Brook for Free Pascal, choose the Simple CGI application option as shown in the figure below: |
Save and compile the project. Copy the resulting file to the CGI directory of your web server and enjoy! See the final result:
Almost all of these plugins can be used separatly, not necessarily bundled with Brook.
The source code of the Brook for Free Pascal is distributed under the GNU Lesser General Public License. See the project licence for copyright/license details.
The stable version of Free Pascal & Lazarus.
The project documentation is available in two formats: HTML and PDF.
For transparency and insight into our release cycle, and for striving to maintain backward compatibility, Brook for Free Pascal will be maintained under the Semantic Versioning guidelines as much as possible.
Releases will be numbered with the following format:
<major>.<minor>.<release>
And constructed with the following guidelines:
For more information on SemVer, please visit http://semver.org.
Please use the issues page. Your cooperation will be appreciated.
Brook would not be possible without important and active contributors. See their names here.
See the name of all donors here.
You can download the last release here. Alternatively, you can also follow the project’s GIT repository. The address is:
https://github.com/risoflora/brookfreepascal.git
The Brook supports third party solutions and, for these, there is a broker file implementing your features. You can download the package containing all files here.