-
Notifications
You must be signed in to change notification settings - Fork 10
Getting Started
Dio Affriza edited this page Jul 26, 2018
·
2 revisions
Create two files:
-
project_kyoukai.lpr; -
unit1.pas;
In project_kyoukai.lpr, type:
program project_kyoukai;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes,
kyoukai.standard.HTTPApplication,
{You must placed your module units here or Kyoukai can't register anything!}
unit1
{ you can add units after this };
{$R *.res}
begin
KyoukaiApp.Port := 80;
KyoukaiApp.Run;
end.In unit1.pas, type:
unit unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils,
Kyoukai.Standard.WebRouter,
Kyoukai.Standard.WebModule;
type
THome = class(TKyModule)
published
procedure MainHandle;
end;
implementation
procedure THome.MainHandle;
begin
echo('Hello world!');
end;
initialization
Routes['main'] := THome;
end.Compile and run the project project_kyoukai.lpr. Now, in your web browser, access the following URL:
http://localhost/
- Home
- Why Kyoukai Instead Of FastPlaz or Brook?
- Getting Started
- Compiling Project
- Usage
- How It Works
- Dynamic Routing With Modules
- Static Routing With Files
- HTTP Request
- HTTP Response
- HTTP Variables