Daraja is a flexible HTTP server framework for Object Pascal, based on the non-visual HTTP server component in the free open source library Internet Direct (Indy).
Daraja provides the core foundation for serving HTTP resources of all content-types such as HTML pages, images, scripts, web service responses etc. by mapping resource paths to your own code. Your code then can create the response content, or let the framework serve a static file.
Included example projects show its usefulness for advanced uses case, such as OAuth 2.0 and OpenID Connect for Microsoft Entra ID and Google Identity platform.
http://michaeljustin.github.io/daraja-framework/
A Getting Started document (PDF) is available at https://www.habarisoft.com/daraja_framework/3.0-MS1/docs/DarajaFrameworkGettingStarted.pdf
Visit https://www.habarisoft.com/daraja_framework.html for more information.
Example:
<daraja-home>source;<indy-home>LibCore;<indy-home>LibProtocols;<indy-home>LibSystem
A resource handler is responsible for the generation of the HTTP response matching a specific client request. The routing between the actual HTTP request and the resource handler is defined by 'mapping' rules.
For example, a resource handler could be mapped to /context1/index.html with an absolute path mapping:
Context1.Add(TIndexPageResource, '/index.html');There are two other supported mapping types: prefix mapping ('/sub1/', '/sub2/' ...) and suffix mapping ('.html', '.pdf' ...). All mappings are checked in a defined order to find the responsible resource handler.
In addition to resource handlers, the application may also include resource filters. With filters, HTTP traffic can be modified in many ways, such as:
All mapping types may also be used for resource filters.