Tänzer:一个可爱的Tcl Web服务器框架
Tänzer: The lovable web server framework for Tcl

原始链接: https://tanzer.io/

Tänzer是一个极简且异步的Tcl Web服务器框架,旨在轻松创建HTTP/1.1 Web应用程序。它旨在简化Tcl中的Web开发,提供一个直接处理Web请求的环境。 其主要特性包括基于模式的请求路由引擎、SCGI客户端和服务器支持、CGI可执行文件支持以及快速的静态文件服务。Tänzer构建在Tcl 8.6之上。 该框架简化了常见的Web服务器任务,例如管理保持活动连接、解析HTTP消息和支持SCGI/CGI协议。使用Tänzer,开发者可以快速构建Web服务,其简单的“Hello, world!”示例就证明了这一点。

Hacker News上的一篇帖子重点介绍了Tänzer,一个用于Tcl的Web服务器框架。作者Tomte对积极的评价表示感谢。评论者称赞了该框架的设计,并对Tcl缺乏广泛采用表示惋惜。 teruakohatu设想了一个Tclsh取代bash成为默认shell的平行世界。dlachausse希望Tcl能够取代浏览器中的JavaScript。BoingBoomTschak将bash的成功归因于其与Bourne shell的兼容性,并指出了Tcl由于其`exec`命令的问题而作为shell的不足之处。doublerabbit提到了NaviServer,一个AOLserver的派生版本,作为另一个基于Tcl的Web服务器选项。

原文

What is tänzer?

tänzer is a minimalistic web server framework for Tcl which provides a very straightforward environment for writing HTTP/1.1 web applications. tänzer is a work in progress.

Features

Asynchronous HTTP/1.1 web server

Pattern-based request routing engine

SCGI client and server support

CGI executable support

Fast static file service

Works out-of-the-box on Tcl 8.6

Writing asynchronous web applications shouldn't have to be complicated. Fortunately, tänzer is there to take you on a dance journey through the perils of keepalive requests, HTTP message parsing, and SCGI and CGI support. Writing "Hello, world!" with tänzer is a snap! And so is everything else you want to do. Write your app with tänzer today.

From zero to web service in no time flat!

package require tanzer set server [::tanzer::server new] $server route GET /* {.*:8080} apply { {event session args} { if {$event ne "write"} { return } $session response -new [::tanzer::response new 200 { Content-Type "text/plain" X-Foo "bar" }] $session response buffer "Hello, world!" $session respond $session nextRequest } } $server listen 8080

联系我们 contact @ memedata.com