All Projects → dbohdan → jimhttp

dbohdan / jimhttp

Licence: MIT license
A library collection and web microframework

Programming Languages

tcl
693 projects

Projects that are alternatives of or similar to jimhttp

awesome-kotlin-libraries-for-android
😎 A curated list of awesome Kotlin libraries for Android.
Stars: ✭ 53 (+112%)
Mutual labels:  libraries
clients-generator
Kaltura API Client Libraries Generator - PHP source code introspection based automation for API native SDKs generation for various programming languages and API platforms
Stars: ✭ 17 (-32%)
Mutual labels:  libraries
app
Aplus Framework App Project
Stars: ✭ 338 (+1252%)
Mutual labels:  libraries
Windows-911
Curated list of FREE emergency resources when you find yourself in the inevitable pickle with Windows. PRs welcome!
Stars: ✭ 24 (-4%)
Mutual labels:  libraries
framestack
Tools, Frameworks & Libraries to help you build your projects ✨
Stars: ✭ 27 (+8%)
Mutual labels:  libraries
ncms
Java CMS engine. Host and develop multiple websites inside a single instance through the GUI and benefit from features like A/B testing, affiliate tracking tools, and a high performance template engine with CSS stylesheets processing & scripts minification.
Stars: ✭ 32 (+28%)
Mutual labels:  web-framework
redis
efficient client ⚡️
Stars: ✭ 70 (+180%)
Mutual labels:  redis-client
alef-component
Alef Component for Modern Web Apps.
Stars: ✭ 46 (+84%)
Mutual labels:  web-framework
node-redis-connection-pool
A node.js connection manager for Redis
Stars: ✭ 52 (+108%)
Mutual labels:  redis-client
aioredis-cluster
Redis Cluster support extension for aioredis
Stars: ✭ 21 (-16%)
Mutual labels:  redis-client
koa
A golang framework like koa.js and has the best performance with net/http.
Stars: ✭ 30 (+20%)
Mutual labels:  web-framework
recurse
Qt based micro web framework with middleware design
Stars: ✭ 19 (-24%)
Mutual labels:  web-framework
CloudStructures
Redis Client based on StackExchange.Redis.
Stars: ✭ 124 (+396%)
Mutual labels:  redis-client
SmartRedis
SmartSim Infrastructure Library Clients.
Stars: ✭ 37 (+48%)
Mutual labels:  redis-client
zig-gamedev
Building game development ecosystem for @ziglang!
Stars: ✭ 1,059 (+4136%)
Mutual labels:  libraries
Polyel-Framework
⚡️ Voltis Core: A PHP framework based on Swoole from the ground up
Stars: ✭ 22 (-12%)
Mutual labels:  web-framework
AppsUsageMonitorAPI
Library for fetching usage stats of applications in an android device.
Stars: ✭ 58 (+132%)
Mutual labels:  libraries
simple redis
Simple and resilient redis client for rust.
Stars: ✭ 21 (-16%)
Mutual labels:  redis-client
java-redis-client
OpenTracing Instrumentation for Redis Client
Stars: ✭ 31 (+24%)
Mutual labels:  redis-client
endpoints
Lightweight REST api backend framework that automatically maps urls to python modules and classes
Stars: ✭ 30 (+20%)
Mutual labels:  web-framework

jimhttp

A collection of standalone libraries and a web microframework prototype for Jim Tcl. Most of the libraries also work in Tcl 8.x. The libraries implement command line and proc argument parsing, an HTML DSL, parsing and generating JSON, templates, and persistent storage powered by SQLite3. The web microframework provides a rough implementation of the HTTP/1.1 protocol and a routing DSL.

Components

The components listed below work in Tcl 8.5, Tcl 8.6, Tcl 8.7a3, and Jim Tcl 0.76 or later unless indicated otherwise. Each component is versioned separately. Component version numbers follow semantic versioning. A major version number of zero indicates an unstable API.

Filename Function Version
arguments.tcl Command line argument parsing. 1.0.0
example.tcl1 A sample web server that demonstrates the use of the other components.
entities.tcl A dictionary mapping characters to HTML entities. 1.0.0
html.tcl A DSL for HTML generation. Requires entities.tcl. 0.2.1
http.tcl1 The titular web microframework. Requires mime.tcl. 0.15.2
json.tcl JSON generation with schema support. 3 JSON parsing. 4 2.1.3
mime.tcl Rudimentary MIME type detection based on the file extension. 1.2.0
rejim.tcl2 A basic Redis client. 0.2.0
storage.tcl1 SQLite persistence of static variables. 0.2.0
template.tcl tmpl_parser templating. 1.0.0
testing.tcl A test framework with support for tcltest-style constraints. 0.5.0
tests.tcl Tests for the other components. 5

1. Jim Tcl-only.

2. Does not support Tcl 8.5.

3. Schemas define data types. See the example below.

4. Warning: parsing is fairly slow in general and extremely slow in UTF-8 builds of Jim Tcl. (Obsolete benchmark.) This may matter to you if you need to decode more than a few dozen KiB of JSON at a time. Since version 0.79 Jim Tcl can be built with a fast binary extension for parsing and encoding JSON. The jq module is an option for faster JSON parsing in earlier versions. It requires an external binary.

5. Only compatible components are tested in Tcl 8.

Use examples

http.tcl

source http.tcl

::http::add-handler GET /hello/:name/:town {
    ::http::respond [::http::make-response \
            "Hello, $routeVars(name) from $routeVars(town)!"]
}

::http::start-server 127.0.0.1 8080

http.tcl and storage.tcl

source http.tcl
source storage.tcl

::http::add-handler GET /counter-persistent {{counter 0}} {
    ::storage::restore-statics

    incr counter

    ::storage::persist-statics
    ::http::respond [::http::make-response $counter]
}

::storage::init
::http::start-server 127.0.0.1 8080

json.tcl

# This produces the output
# {"a": "123", "b": 123, "c": [123, 456], "d": "true", "e": true}
source json.tcl

puts [::json::stringify {
    a 123
    b 123
    c {123 456}
    d true
    e true
} 0 {
    a string
    c {N* number}
    d string
}]

Requirements

Compile Jim Tcl 0.76 or later from its Git repository. Stable releases prior to that (0.75 and earlier) will not work. You will need an SQLite3 development package (libsqlite3-dev on Debian and Ubuntu, libsqlite3x-devel on Fedora, sqlite3-devel on openSUSE Tumbleweed) to do this and optionally AsciiDoc (asciidoc on Debian and Ubuntu, Fedora, and openSUSE) to generate the documentation (don't use the option --disable-docs in that case).

git clone https://github.com/msteveb/jimtcl.git
cd jimtcl
./configure --with-ext="oo tree binary sqlite3" --enable-utf8 --ipv6 --disable-docs
make
sudo make install

Once you have installed Jim Tcl you can clone this repository and try out the example by running

git clone https://github.com/dbohdan/jimhttp.git
cd jimhttp
jimsh example.tcl

and then pointing your web browser at http://localhost:8080/.

License

MIT.

static.jpg photo by Steven Lewis. License: CC0.

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].