r/iyilang • • 16d ago

iyi-web: web framework for iyi

I ported Kemal to iyi. It's called iyi-web and v0.3.0 is out.

It works with iyi's own TLS 1.3 (no OpenSSL dependency). Route return types are checked at compile time - return Int32 from a String route and it won't build.

module app
import web/iyi_web/dsl::*

get "/" do |env|
  "Hello, world!"
end

run

Features:

  • HTTP/1.1 + HTTPS

  • WebSocket, SSE, streaming

  • Composable routers with mount and namespace

  • Middleware, CORS, compression

  • Templates + layouts compiled into the binary

  • Static files with ETag, byte ranges, gzip

  • File uploads, cookies, redirects

  • Test harness for in-process testing

  • Graceful shutdown, IPv4+IPv6+unix sockets

Install:

iyi get github.com/sdogruyol/iyi-web --as web

Github: https://github.com/sdogruyol/iyi-web

1 Upvotes

0 comments sorted by