All Projects → michaelJustin → Daraja Framework

michaelJustin / Daraja Framework

Licence: other
A lightweight HTTP server framework for Object Pascal (Delphi 2009+/Free Pascal 3.0) based on Indy

Programming Languages

pascal
1382 projects
delphi
115 projects

Projects that are alternatives of or similar to Daraja Framework

Suave
Suave is a simple web development F# library providing a lightweight web server and a set of combinators to manipulate route flow and task composition.
Stars: ✭ 1,196 (+1007.41%)
Mutual labels:  http-server
Searchspot
The service responsible for Honeypot's ElasticSearch data
Stars: ✭ 90 (-16.67%)
Mutual labels:  http-server
Gaea
Gaea is a Gin-based web framework, reference gin https://github.com/gin-gonic/gin
Stars: ✭ 105 (-2.78%)
Mutual labels:  http-server
React Native Http Bridge
HTTP server for React Native
Stars: ✭ 79 (-26.85%)
Mutual labels:  http-server
Piping Server Rust
Infinitely transfer between any device over pure HTTP, designed for everyone using Unix pipe and even for browser users
Stars: ✭ 88 (-18.52%)
Mutual labels:  http-server
Meinheld
Meinheld is a high performance asynchronous WSGI Web Server (based on picoev)
Stars: ✭ 1,339 (+1139.81%)
Mutual labels:  http-server
Gock
HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽
Stars: ✭ 1,185 (+997.22%)
Mutual labels:  http-server
Netty Rest
Yet another high performance REST server based on Netty
Stars: ✭ 107 (-0.93%)
Mutual labels:  http-server
Proxy.py
⚡⚡⚡Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging
Stars: ✭ 1,291 (+1095.37%)
Mutual labels:  http-server
Violetear
Go HTTP router
Stars: ✭ 100 (-7.41%)
Mutual labels:  http-server
Hgw
hgw是由gateway网关服务、manager控制服务构成的一套轻量级网关系统。目前支持http/https协议的服务控制
Stars: ✭ 81 (-25%)
Mutual labels:  http-server
Tinyhttp
🦄 0-legacy, tiny & fast web framework as a replacement of Express
Stars: ✭ 1,259 (+1065.74%)
Mutual labels:  http-server
Http.swift
A tiny HTTP server engine written in swift.
Stars: ✭ 99 (-8.33%)
Mutual labels:  http-server
Nettygameserver
使用netty4.X实现的手机游戏分布式服务器,支持tcp,udp,http,websocket链接,采用protobuf自定义协议栈进行网络通信,支持rpc远程调用,使用mybatis3支持db存储分库分表,支持异步mysql存储,db保存时同步更新reids缓存。 使用ExcelToCode工程,将excel数据生成java类和json数据字典,DictService直接读取json,减少数据字典部分代码。使用game-executor工程,增加游戏内的异步事件全局服务, 支持事件sharding,均衡的异步执行事件逻辑
Stars: ✭ 1,203 (+1013.89%)
Mutual labels:  http-server
Restbed
Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++14 applications.
Stars: ✭ 1,551 (+1336.11%)
Mutual labels:  http-server
Envelop.c
🌊 Thread-less, event-loop based tiny http-server from scratch using epoll. Learning Purpose.
Stars: ✭ 75 (-30.56%)
Mutual labels:  http-server
T Io
解决其它网络框架没有解决的用户痛点,让天下没有难开发的网络程序
Stars: ✭ 1,331 (+1132.41%)
Mutual labels:  http-server
Httpbin
HTTP Request & Response Service, written in Python + Flask.
Stars: ✭ 10,423 (+9550.93%)
Mutual labels:  http-server
Mofuw
mofuw is *MO*re *F*aster, *U*ltra minimal *W*ebserver.
Stars: ✭ 107 (-0.93%)
Mutual labels:  http-server
Cherrypy
CherryPy is a pythonic, object-oriented HTTP framework. https://docs.cherrypy.org/
Stars: ✭ 1,363 (+1162.04%)
Mutual labels:  http-server

Daraja HTTP Framework

Daraja is a flexible HTTP server framework for Object Pascal, based on the stand-alone HTTP server 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.

Optional Extensions

daraja-restful

A RESTful framework extension, version 1.0 is compatible with Delphi 2009 and newer. Version 2.0 introduces support for Free Pascal, using a slightly different configuration of RESTful resource handlers.

https://github.com/michaelJustin/daraja-restful

slf4p

A simple logging facade with support for LazLogger, Log4D, and other logging frameworks.

https://github.com/michaelJustin/slf4p

You can find this project at https://github.com/michaelJustin/daraja-framework

Documentation

API generated with doxygen

http://michaeljustin.github.io/daraja-framework/

Getting Started PDF

A Getting Started document (PDF) is available at https://www.habarisoft.com/daraja_framework/2.0/docs/DarajaFrameworkGettingStarted.pdf

Project home page

Visit https://www.habarisoft.com/daraja_framework.html for more information.

IDE configuration

Required paths

  • The project search path must include the Indy and Daraja source directories.

Example:

<daraja-home>\source;<indy-home>\Lib\Core\;<indy-home>\Lib\Protocols\;<indy-home>\Lib\System\

  • The project search path for Include files must include the Indy Core path.

Example:

<indy-home>\Lib\Core\

Optional source

Some useful (but optional) units are located in the optional subfolder. Include it when needed:

<daraja-home>\source;<daraja-home>\source\optional;<indy-home>\Lib\Core\;<indy-home>\Lib\Protocols\;<indy-home>\Lib\System\

Usage example: contexts

In the Daraja Framework, contexts are used for the high-level separation of HTTP resources, depending on their first path segment. Here is an example which uses two contexts, 'context1' and 'context2':

http://example.com/context1/index.html
http://example.com/context2/other.html

This example uses 'news', 'files' and 'admin' contexts:

http://example.com/news/index.html
http://example.com/files/doc1.pdf
http://example.com/admin/login.html

Code

In the Daraja Framework, creating a context only requires the context name as the parameter of the TdjWebAppContext constructor:

  Server := TdjServer.Create;
  try
    Context1 := TdjWebAppContext.Create('context1');
    Server.AddContext(Context1); 
    Context2 := TdjWebAppContext.Create('context2');
    Server.AddContext(Context2); 
    Server.Start;
    ... 

Dynamic resource handlers

Contexts need resource handlers to process requests. A resource handler is responsible for the generation of the HTTP response matching a specific client request.

However, the routing between the actual HTTP request and the resource handler is performed via 'mapping' rules.

For example, a resource handler which returns a HTML document could be mapped to the /context1/index.html resource path with this absolute path resource handler mapping:

  Context1.Add(TIndexPageResource, '/index.html');

Alternatively, a more general suffix mapping resource handler may be used, which should handle requests to any resources with the extension *.html:

  Context1.Add(TCatchAllHtmlResource, '*.html');

This resource handler will be invoked for all requests for *.html resources - independent of their actual document name, and also for resources in sub-paths like /context1/this/works/with_any_page.html. (But note: the resource handler will not receive requests for other context, such as /context2/index.html!)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].